Skip to content

android.system.ErrnoException: sendto failed: EPIPE (Broken pipe) #61

@luisribeiro

Description

@luisribeiro

Hi there,
I connect socket and it throws an exception with the message sendto failed: EPIPE (Broken pipe) after 5 seconds (with master version).
When I use v0.2.0 version, the socket is closed with code 1011. I've seen the meaning of this code

1011 indicates that a server is terminating the connection because
      it encountered an unexpected condition that prevented it from
      fulfilling the request.

I'm following the README sample to create the connection. What could be wrong? We've tested the socket server with iOS and it works.

final String SOCKET_URL_TEMPLATE = "ws://socket.test.com/socket/websocket?token=%s&vsn=2.0.0";
String url = String.format(SOCKET_URL_TEMPLATE, "token_xpto");

socket = new Socket(url);
            socket.onOpen(new ISocketOpenCallback() {
                @Override
                public void onOpen() {
                    Log.d("[SOCKET_TEST]", "socket opened");
//                    this part connects and join the channel, but the error occurs even without this part
//                    simpleChannelConnection();
                }
            });

            socket.onClose(new ISocketCloseCallback() {
                @Override
                public void onClose() {
                    Log.d("[SOCKET_TEST]", "socket closed");
                }
            });

            socket.onError(new IErrorCallback() {
                @Override
                public void onError(String s) {
                    Log.d("[SOCKET_TEST]", "socket error - " + s);
                }
            });

            socket.onMessage(new IMessageCallback() {
                @Override
                public void onMessage(Envelope envelope) {
                    Log.d("[SOCKET_TEST]", "socket message - " + envelope.toString());
                }
            });

            socket.reconectOnFailure(false);
            socket.connect();

Thank you.

Luis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions