CSC209H1 Lecture Notes - Errno.H, Connectionless Communication, Telnet

57 views1 pages
25 Apr 2013
School
Course
Professor

Document Summary

Server side process: int socket(int family, int type, int protocol): family specifies protocol family for the socket int accept(int socfd, struct sockaddr *cliaddr, socklen_t *addrlen), blocks waiting for a connection (from the queue) Unblocks when a new connection is established: socfd is the listening socket, cliaddr is the address of the client. Pass in a pointer to the struc sockaddr_in for the client: returns a new descriptor which refers to the tcp connection w/ the client. Reads and writes on the connection will use the socket returned by accept() Client side process: int socket(int family, int type, int protocol): create a socket with the same specifications as the server. Will block until server responds with the accept() call. Pf_inet inet doman (ipv4) the one to be used. Pf_local unix domain for when there"s both processes and the same machine: type specifies the type of socket. Sin_addr. s_addr can be set to inaddr_any to communicate on any network interface.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions