CSE 124 Lecture Notes - Lecture 5: Network Socket, File Descriptor, Readwrite

24 views3 pages

Document Summary

Steps: create network socket, bind socket to an interface, tell the socket to listen for. Incoming connections: accept an incoming connection, read/write to the socket, close the socket. Socket api used: socket(, bind(, listen(, accept(, send/recv(, close() Either the client or server can close the connection! Servers may have more than 1 networking interface! If you create a socket, you want to bind it to a particular ip address. As a client, you don"t necessarily care what your ip/port # is! That is why bind() on the client side is optional. If i am a server, i am required to specify a port #! But you don"t have to specify an ip address! Server listen - mark has having a server personality . Backlog - controls how many incoming connections are allowed that started but have not been acknowledged inside a queue. The queue is defined inside of the os.

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