Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Plans to add support for DatagramSocket?

Hey,

Are there any plans to add support for the DatagramSocket?

http://developer.android.com/reference/java/net/DatagramSocket.html

I don't know if there's anything equivalent for the iPhone but basically I'm looking for a way to send and receive messages in an app via UDP.

Thanks,
Justin

— asked November 18th 2010 by Justin Toth
  • udp
0 Comments

2 Answers

  • There is a UDP module in the public modules repository now. It supports both iOS and Android, and lets you send packets to specific addresses or broadcast them out. You can also receive packets, and read their data as strings or as a byte array. This was created in the last several weeks, so please bear with any issues mass use uncovers! Feel free to send in pull requests for any fixes or enhancements you want to make to the module. Cheers!

    https://github.com/appcelerator/titanium_modules

    (Note: If you are using Android with Ti SDK 1.7.5 or earlier, you will need to use the apilevel_1 branch of the above repository! The master branch is for 1.8.0.1 with dual runtime (V8 and Rhino) support.)

    — answered December 21st 2011 by Dawson Toth
    permalink
    0 Comments
  • For others who want UDP support, Chris created a udp module for iOS.

    https://github.com/chrisfjones/titanium_module_udp

    — answered October 12th 2011 by Justin Toth
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.