23.4. Establishing a Simple TCP Server Using Stream Sockets

Typically, with TCP, a server “listens” (i.e., waits) for a connection request from a client. Often, the server program contains a control statement or block of code that executes continuously until the server receives a request. On receiving a request, the server establishes a connection to the client. The server then uses this connection—managed by a Socket object—to handle future requests from that client and to send data to the client. Since programs that communicate via TCP process the data they send and receive as streams of bytes, programmers sometimes refer to Sockets used with TCP as “stream Sockets.”

Establishing a simple server with TCP and stream sockets requires five steps. ...

Get Visual Basic 2005 for Programmers: Deitel Developer Series, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.