23.6. Client/Server Interaction with Stream-Socket Connections

Figures 23.1 and 23.2 use the classes and techniques discussed in the previous two sections to construct a simple client/server chat application. The server waits for a client’s request to make a connection. When a client application connects to the server, the server application sends a String to the client, indicating that the connection was successful. The client then displays a message notifying the user that a connection has been established.

Figure 23.1. Server portion of a client/server stream-socket connection.
					1
					' Fig. 23.1: FrmChatServer.vb
					2
					' Set up a server that will receive a connection from a client, send a
					3
					' string to the client, chat with the client and close the ...

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.