/socket.io-titanium

socket.io for titanium mobile

Primary LanguageActionScriptOtherNOASSERTION

socket.io-titanium
------------------

socket.io@0.8.5

How to use
==========

  * run server(chat server)

    shell > node prj/example-nodejs-server/chat.js

  * client(chat client)
    
    * DIR
      prj/
       - README
       - LICENSE
       - tiapp.xml
       - example-nodejs-server/
         - server.js
         - chat.js
       - Resources/
        - app.js
        - socket.io-titanium.js
        - socket.io/
          - package.json
          - lib/
            - io.js
            - socket.js
            - util.js
            - transport.js
            - transports/
              - xhr.js
              - xhr-polling.js

    [js code]
    var io = require('socket.io-titanium');
    var socket = io.connect('169.254.10.100:8080');
    socket.send('hello world!!');
    socket.on('message', function (message){
      Titanium.API.debug('got message: ' + message);
    });

Notes
=====

  * Mac OSX
    
  run with iphonesim or android:
    set localnetwork alias localhost(127.0.0.1)::

    shell > sudo ifconfig lo0 alias 169.254.10.100 netmask 0xffffff
    
    run iphonesimlator..

    [js code]
      var socket = io.connect('169.254.10.100:8080');
      socket.send('hello world!!');
      socket.on('message', function (message){
        ...
      });

  * android client:
    add property tiapp.xml
    <property name="ti.android.threadstacksize" type="int">32768</property>