Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Berkeley sockets
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===accept=== When an application is listening for stream-oriented connections from other hosts, it is notified of such events (cf. [[Select (Unix)|select()]] function) and must initialize the connection using function ''accept()''. It creates a new socket for each connection and removes the connection from the listening queue. The function has the following arguments: * <var>sockfd</var>, the descriptor of the listening socket that has the connection queued. * <var>cliaddr</var>, a pointer to a sockaddr structure to receive the client's address information. * <var>addrlen</var>, a pointer to a ''socklen_t'' location that specifies the size of the client address structure passed to accept(). When ''accept()'' returns, this location contains the size (in bytes) of the structure. ''accept()'' returns the new socket descriptor for the accepted connection, or the value ''-1'' if an error occurs. All further communication with the remote host now occurs via this new socket. Datagram sockets do not require processing by accept() since the receiver may immediately respond to the request using the listening socket.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)