The clientconnected socket must be ordered to

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for a given transport (e.g., TCP) and internet protocol (e.g., IPv4); Set the “server” socket op=ons (e.g., at socket ­ level, whether it is reusable); Bind the “server”socket to a host address (e.g., localhost) and a port (e.g., 51243); Start listening to connec=ons on the “server” socket (but does not block here) and set the maximum number (e.g., 5) that could be le] wai=ng; Server ­Side Sockets (3) 14   The connec=on ­handling stage is a loop in which:           The “server” socket first blocks wai=ng to accept connec=ons; When a connec=on is accepted, two pieces of informa=on result: the new, client ­connected socket that has been created and the host and port of connec=ng client; The server process then handles the connec=on, e.g., it could spawn a dispatcher (e.g., a thread) passing it the socket to be used and start it; The serve...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online