• 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: Dado Colussi <email@hidden>
  • Date: Sun, 25 Jun 2017 08:16:33 -0500

It's incorrect to call connect() twice.

Try this:
Call connect() on the non-blocking TCP socket and expect it to return -1
and to set errno to EINPROGRESS. Then select() the socket for writing. 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.

Dado
 _______________________________________________
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: Carl Hoefs <email@hidden>
  • Next by Date: 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