[Libwebsockets] [libwebsockets] With new nonblocking socket setting on iOS socket fails on EISCONN (#17)
LANGLOIS Olivier PIS -EXT
olivier.pis.langlois at transport.alstom.com
Tue Oct 29 18:59:46 CET 2013
> -----Original Message-----
> From: Andy Green [mailto:extracats at googlemail.com] On Behalf Of "Andy
> Green (???)"
> Sent: Thursday, October 24, 2013 10:06 AM
> To: warmcat/libwebsockets; libwebsockets
> Subject: Re: [Libwebsockets] [libwebsockets] With new nonblocking socket
> setting on iOS socket fails on EISCONN (#17)
> On 24/10/13 21:10, the mail apparently from shyswork included:
> > With new nonblocking socket setting on iOS websocket is closed with
> > EISCONN 56. It appears that in client-handshake.c in line 87
> > (https://github.com/warmcat/libwebsockets/blob/master/lib/client-hands
> > hake.c#L87) only EALREADY and EINPROGRESS are checked. In my situation
> > I get there first time with EINPROGRESS which is ok but the next time
> > I get EISCONN which leads to fail. I have put simple check for EISCONN
> > as quick and dirty fix but I haven't tested it thoroughly.
> Sorry can you help me understand why we see EISCONN?
This can be returned by connect():
1. If you attempt to connect an already connected socket or
2. current socket state is unconnected and the connection completes before returning from connect (is unusual for nonblocking but maybe possible with loopback interface).
Maybe on iOS, connect() syscall simply disregard the nonblocking attribute and perform a blocking connect() and indicate success by returning EISCONN.
Apples OSes do not have the reputation to be very strict with POSIX compliance. Just saying...
In anycase, I think this should not be considered as a fatal error on Linux or any other platform.
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.
More information about the Libwebsockets