Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapping socket functions #2

Closed
11 of 12 tasks
czechboy0 opened this issue Mar 4, 2016 · 1 comment
Closed
11 of 12 tasks

Wrapping socket functions #2

czechboy0 opened this issue Mar 4, 2016 · 1 comment

Comments

@czechboy0
Copy link
Collaborator

czechboy0 commented Mar 4, 2016

  • socket() creates a new socket of a certain socket type, identified by an integer number, and allocates system resources to it
  • bind() is typically used on the server side, and associates a socket with a socket address structure, i.e. a specified local port number and IP address
  • listen() is used on the server side, and causes a bound TCP socket to enter listening state.
  • connect() is used on the client side, and assigns a free local port number to a socket. In case of a TCP socket, it causes an attempt to establish a new TCP connection
  • accept() is used on the server side. It accepts a received incoming attempt to create a new TCP connection from the remote client, and creates a new socket associated with the socket address pair of this connection
  • send() and recv(), or write() and read(), or sendto() and recvfrom(), are used for sending and receiving data to/from a remote socket
  • close() causes the system to release resources allocated to a socket. In case of TCP, the connection is terminated
  • gethostbyname() and gethostbyaddr() are used to resolve host names and addresses. IPv4 only.
  • select() is used to pend, waiting for one or more of a provided list of sockets to be ready to read, ready to write, or that have errors
  • poll() is used to check on the state of a socket in a set of sockets. The set can be tested to see if any socket can be written to, read from or if an error occurred
  • getsockopt() is used to retrieve the current value of a particular socket option for the specified socket
  • setsockopt() is used to set a particular socket option for the specified socket
@czechboy0 czechboy0 modified the milestone: Phase 1: Corelib Mar 4, 2016
@czechboy0 czechboy0 assigned czechboy0 and unassigned czechboy0 Mar 20, 2016
@czechboy0 czechboy0 removed this from the Phase 1: SocksCore milestone Jun 6, 2016
@czechboy0
Copy link
Collaborator Author

Closing as we covered pretty much everything (except for poll). We'll add that if there's demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant