• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Issuing connect(2) after select(2) on non-blocking socket
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issuing connect(2) after select(2) on non-blocking socket


  • Subject: Re: Issuing connect(2) after select(2) on non-blocking socket
  • From: Carl Hoefs <email@hidden>
  • Date: Mon, 26 Jun 2017 11:58:15 -0700

> On Jun 25, 2017, at 6:16 AM, Dado Colussi <email@hidden> wrote:
>
> When select() indicates that the socket is ready for writing, check the
> status of the asynchronous connect() using getsockopt() with SO_ERROR. If
> there's nothing accepting the connection, then getsockopt() should give you
> ECONNREFUSED.

getsockopt() isn't returning ECONNREFUSED...

After the connect() returns EINPROGRESS, and after the select() indicates 1
descriptor ready for write, getsockopt() returns status=0, errno=0:

             status = getsockopt(sockfd,SOL_SOCKET,SO_ERROR,&error,&len);

So I'm still forced to reissue the connect() to see if I can connect.
-Carl

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Issuing connect(2) after select(2) on non-blocking socket
      • From: Dado Colussi <email@hidden>
References: 
 >Re: Issuing connect(2) after select(2) on non-blocking socket (From: Dado Colussi <email@hidden>)

  • Prev by Date: Re: Issuing connect(2) after select(2) on non-blocking socket
  • Next by Date: Re: Issuing connect(2) after select(2) on non-blocking socket
  • Previous by thread: Re: Issuing connect(2) after select(2) on non-blocking socket
  • Next by thread: Re: Issuing connect(2) after select(2) on non-blocking socket
  • Index(es):
    • Date
    • Thread