Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I don't know if that is an issue but i think so... INFO/AsyncHttpSocket(3876) #20

Closed
kronsi opened this issue May 24, 2013 · 7 comments
Closed

Comments

@kronsi
Copy link

kronsi commented May 24, 2013

i got a local socket.io server, that gave a response on connect with you lib.
but than i became

INFO/AsyncHttpSocket(3876): com.koushikdutta.async.http.AsyncSSLSocketMiddleware Not keeping non-owned socket: null

and than i send text to the socket for the android device and there is no response...

public void socketConnect(){
String socketUrl = "http://192.168.0.117:7788";
Log.d("Socket ", " try to connect "+ socketUrl +" " + UserData.getInstance().getToken());
SocketIOClient.SocketIORequest request = new SocketIOClient.SocketIORequest( socketUrl );
request.setHeader("token", UserData.getInstance().getToken());

    SocketIOClient.connect(AsyncHttpClient.getDefaultInstance(), request, new SocketIOClient.SocketIOConnectCallback() {
        @Override
        public void onConnectCompleted(Exception ex, SocketIOClient client) {
            if (ex != null) {
                Log.d("Socket", "no connection " + ex.getMessage());
                ex.printStackTrace();
                return;
            }

            Log.d("Socket", "maybe connected?");
            client.setStringCallback(new SocketIOClient.StringCallback() {
                @Override
                public void onString(String string) {
                    Log.d("Socket", "string... conn. lalalal");
                    System.out.println(string);
                }
            });

            client.setEventCallback(new EventCallback() {
                @Override
                public void onEvent(String event, org.json.JSONArray arguments) {
                    //To change body of implemented methods use File | Settings | File Templates.
                    Log.d("Socket", "Event");
                }
            });
            client.setJSONCallback(new SocketIOClient.JSONCallback() {
                @Override
                public void onJSON(org.json.JSONObject json) {
                    //To change body of implemented methods use File | Settings | File Templates.
                    Log.d("Socket", "JSON");
                }
            });

        }

    });
}
@koush
Copy link
Owner

koush commented May 24, 2013

can you try setting the closed callback and see if that event gets fired?

@kronsi
Copy link
Author

kronsi commented May 24, 2013

thanks for your fast support. I try it, but nope... the closed event wasn't fired

@koush
Copy link
Owner

koush commented May 24, 2013

what server are you using

@kronsi
Copy link
Author

kronsi commented May 24, 2013

socket.io... but that give me a response...
that is the log output from the java console

05-24 16:28:40.753: DEBUG/Socket(1237): try to connect http://192.168.0.117:7788 e6bec1f1e18edd150fc439b8439e2e6b460ea0de62b2a3e3a01350fd03b5c5952a362911
05-24 16:28:41.453: INFO/AsyncHttpSocket(1237): com.koushikdutta.async.http.AsyncSSLSocketMiddleware Not keeping non-owned socket: null

and that comes from the terminal... so that is the node log...

{ headers:
{ host: '192.168.0.117',
'user-agent': 'Dalvik/1.6.0 (Linux; U; Android 4.2.2; google_sdk Build/JB_MR1.1)',
'accept-encoding': 'gzip, deflate',
connection: 'keep-alive',
accept: '/',
token: 'b449af1c867dac88eb2ec355cc35c201d286c806a582fcf5015edaea9e127ddf01724913' },
address: { address: '192.168.0.117', port: 53847 },
time: 'Fri May 24 2013 18:32:34 GMT+0200 (CEST)',
query: {},
url: '/socket.io/1/',
xdomain: false,
secure: undefined,
issued: 1369413154464 }
Session: b449af1c867dac88eb2ec355cc35c201d286c806a582fcf5015edaea9e127ddf01724913
undefi
{ b449af1c867dac88eb2ec355cc35c201d286c806a582fcf5015edaea9e127ddf01724913: { num: 1 } }

so there is a connection

@kronsi
Copy link
Author

kronsi commented May 24, 2013

I think the event listner is not working for me... but i don't know why...

@koush
Copy link
Owner

koush commented May 24, 2013

Fixed with:

0a1bf13

@koush koush closed this as completed May 24, 2013
@kronsi
Copy link
Author

kronsi commented May 24, 2013

wao, realy cool stuff and support, thanks a lot...!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants