Two Person Chat With The Winsock Control And Visual Basic
The Microsoft WinSock library allows you to connect to a remote machine and exchange data using either the User Datagram Protocol (UDP) or the Transmission Control Protocol (TCP). Both protocols can be used to create client-server applications. In this tutorial Jason will be teaching you how to create a direct-connect chat program that uses TCP. The program itself will be designed in such a way that it can act as both the client and server.
Two Person Chat With The Winsock Control And Visual Basic - Using our chat application (Page 6 of 7 )
To use our chat application, simply download the support material from the last page of this article. Install the compiled version of the chat application on both yours and another friend's computers. If you don't have access to a friendís computer, then you can just install it on your computer for now.
Run the chat application from the start menu: Start -> Programs -> devChat -> devChat. If youíre acting as the client, then enter the IP address of the remote computer into the IP text box, enter you alias, and then click the connect button.
If you're acting as the server, enter your alias and click on the listen button. Once Winsock has completed its connection loop on the client's machine, then you're ready to chat. Click the close button to terminate the current chatting session.
NB: If you only have access to one computer, then that's fine. Start two instances of the program. Click on the listen button in one instance. Switch to the other, enter "127.0.0.1" for the IP address, and click connect. The connect will be established and you can chat away!