nowelium / socket.io-titanium Goto Github PK
View Code? Open in Web Editor NEWsocket.io for titanium mobile
Home Page: http://youtu.be/10ogNjWCpyc
License: Other
socket.io for titanium mobile
Home Page: http://youtu.be/10ogNjWCpyc
License: Other
Socket.io-Titanium has been working great for me, however, when I went to submit my app to iTunes Connect, I was rejected by Apple due to an app crash on launch. I never experienced this in my testing as Socket.io-Titanium works perfectly when building the app for non-distribution. However, when building the app for archive, then creating a distribution IPA and loading the IPA to a device, I am able to recreate the error.
Removing Socket.io-Titanium from the project causes the issue to be remedied.
The build methodology to recreate the problem can be found here: http://developer.apple.com/library/ios/#qa/qa1764/_index.html
The Crash Log is tracing back to: 10 APP NAME 0x0002990a KrollCallAsFunction (KrollMethod.m:70)
Hi Yusuke Hata,
I've tried to use socket.io-titanium today but failed since my Resources/socket.io (https://github.com/LearnBoost/socket.io.git) folder is some how different from the one that you listed in the README.
Also the git link to socket.io from README is also broken.
Please help me take a look,
Thanks,
Phillip Phan
Issue#2
#2 (comment)
#2 (comment)
Hi Yusuke!
Thanks for the updates on this project!
Right now i'm trying to implement websocket connection on Android.
Everything is fine if im broadcasting messages globally, but when I do socket.broadcast.to("xxx") then I don't recieve anything on the phone. Sending messages from phone to node are always fine.
In my app I'm not restricting messages to a namespace, that might be a problem, I'll test it.
This problem occurs only on android, in iOS it's fine.
All the debug info I can provide is (not sure if it is related)
D/TiHttpClient( 1708): (KrollRuntimeThread) [43396,121325] Setting ready state to 1
W/TypeConverter( 1708): jsValueToJavaObject returning null
D/TiHttpClient( 1708): (TiHttpClient-6) [31,121356] Setting ready state to 2
D/TiHttpClient( 1708): (TiHttpClient-6) [1,121357] Setting ready state to 3
D/TiHttpClient( 1708): (TiHttpClient-6) [2,121359] Setting ready state to 4
W/TypeConverter( 1708): jsValueToJavaObject returning null
W/TypeConverter( 1708): jsValueToJavaObject returning null
W/TypeConverter( 1708): jsValueToJavaObject returning null
Thanks for your code. Anyway, do you have any plan for Socket I/O 1.0..? :)
Hi Yusuke Hata,
Are you planning to release support for socket.io v0.7?
Hi, i'm using Titanium 2.0 and Android 4.1 on windows7. I downloaded the folders socket.io and ti-websocket-client and also the file socket.io-titanium.js. I launched the server it works well and i've created a window for a simple test of connexion.
var win = Titanium.UI.currentWindow;
var io = require('./socketio');
var socket = io.connect('10.0.2.2:8080');
var chat = socket.of('/chat');
There is a main.js file where i created the window.
My issue is, when i launch the app the server connects the client numerous times.
After some minutes an error appears :
Location(1231,32):ti-websocket-client/ti-websocket-client.js
Message: Cannot call method 'clear' of undefined
Source : self._socketReadBuffer.clear()
I will be delighted if someone can help. thanks
An error occurs after data transmission, everything is well emit is done successfully, but after a few seconds without activity on the app an error screen appears with the information:
StreamException. Stream is not writable in -TiStreamProxy write:
Feb 21 15:36:58 iPhone-Michel catacao[13898] : [ERROR] Script Error = StreamException. Stream is not writable in -TiStreamProxy write: at ti-websocket-client.js (line 1).
Is there any procedure to be done or the error occurs due to bug?
code:
var io = require('socket.io-titanium');
var socket = io.connect('http://....');
//socket.send('hello world!!');
socket.on('news', function (message){});
var data = {
"room" : 1,
"message": 'mobitxt'
};
Ti.API.info('---> datadd' + data);
socket.emit('emit',data);
hi, im having trouble using socket.io-titanium outside of localhost (port 3001). for example, I've tried deploying the node server code to Appcelerator's nodeacs hosting facility ; it returns a web address of :-> http://8321ca2dc6814087e974996e64c599a8246db6ae.cloudapp-preview2.appcelerator.com
however if I change the var socket = io.connect(''...webaddress..") , this does not work and my client can then not connect to or see the node server app.
can you please give me some guidance on how to get this working. many thanks.
angus
The data is base64 encoded mp3 data. The data is transported in chunks of 1024 bytes and total size of data is around 400000 bytes. Ti is giving buffer out of bounds exception since the default size is 65536. Any idea how to resolve it?
Also while uploading the data, something.on('download', callback) is not fired. It seems to be blocked while something.emit('upload', callback) is in progress and is only starts firing once the data has been completely uploaded . Although server sends a downloaded packet to the client as soon as it gets the uploaded packet. I have used your image uploading example for binary music data bidirectional transport. Is this the default behaviour? Any pointers on this would be helpful.
I'm wondering if there's some kind of special trick to get this running on Android. I got it first try on iPhone, but regardless of what I do on Android I get the same error:
Location : [132,32] ti:/bootstrap.js
Uncaught Error: Invalid value, expected type Number
Source : return Titanium.clearTimeout.apply(Titanium, arguments)
I get this same error on my physical Android device. I have a remote web server with sockets enabled and it works fine with iOS.
If the web server socket is not running, I get no error.
To test your framework i use something like this on the iphone simulator
var io = require('socket.io-titanium');
var socket = io.connect('127.0.0.1:8080');
var chat = socket.of('/chat');
while running my server on my mac.
It connects and works great.
Then i decided to test it on android. Android emulator doesnt seem to work on 127.0.0.1
I can see in the logcat that the connection failed
10-30 11:29:33.996: E/TiHttpClient(877): (TiHttpClient-1) [1001,12561] HTTP Error (org.apache.http.conn.HttpHostConnectException): Connection to http://127.0.0.1:8080 refused
But how do i get that error in my js file?
As connect is done immediately on the socket when doing
var socket = io.connect('127.0.0.1:8080');
It s too late to do socket.on()
after
I really need to know if the conneciton failed! thank you
Would it be possible to add WSS/SSL support to ti-websocket-client.js? It appears that socket.io-titanium properly parses and sets up for secure communication, but the websocket client only supports communication on the WS protocol.
Location:
[8,0] app://socket.io/lib/io.js
Message:
ReferenceError: "window" is not defined. (app://socket.io/lib/io.js#8)
Hi everytime i run the code i get the following issues
[ERROR] Script Error = 'undefined' is not a function (evaluating 'obj.otherwise()') (unknown file)
2012-08-20 09:15:29.483 socketio.titanium[4170:1b50b] *** Terminating app due to uncaught exception of class '__NSCFDictionary'
terminate called throwing an exception
[INFO] Application has exited from Simulator
Can someone tell me what this might be thanks
I am trying to implement socket.io in titanium and its working perfectly over HTTP, however, when attempting to connect via HTTPS I am unable to get past the handshake authorization (the connection
event never fires).
Can you please put together an example of how to implement Socket.IO-Titanium using HTTPS?
Thanks
If I emit a message from the client to the server with a message length greater than 48 characters the connection breaks with a server message of:
websocket parser error: reserved fields must be empty
or
websocket parser error: no handler for opcode #
There seems to be no client-side error triggered on this event.
I am using the Titanium Mobile v1.8.1 SDK with Socket.IO v.8.
Any thoughts on how to resolve?
i'm sorry this is stupid issue.
I've tried all the instructions and ios is fine but android devices do not make any communication with server.
----------------------------------------------------------------- SERVER
var io = require('socket.io').listen(8080);
var chat = io.of('/chat');
chat.on('connection', function(socket){
socket.emit('available_channel', 'asdfasdf');
});
----------------------------------------------------------------- CLIENT in Titanium 3.1
var io = require('socket.io-titanium');
var socket = io.connect('192.168.0.9:8080');
var chat = socket.of('/chat');
chat.on('available_channel', function(channels){
alert(channels);
});
alert('hi there!!!');
android doesn't come in chat.on().
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.