Firstly, we need to check that the program works on one PC. To do this, follow these steps:
1. Run the project.
2. Click both the Client and Server command buttons. Move the windows around so
that you can see them all.
3. Enter the name of the PC into the PCName Text Box. (This appears after the @
sign on the Server form's caption)
4. Click Connect on the Client form.
5. Enter some text into the Send text box on the Client form, and click Send
6. The text should appear in the Receive text box on the Server form.
If you get an error, check that the PC name in the PCName text box, is
the same as the LocalHostName on frmServer. Click
here for how to do this.
7. Now, enter some text into the Send text box on the Server form, and click
Send. The text should appear in the Receive text box on the Client form.
If you have had no errors, then everything works fine. Now, to see the program working over a proper network, follow these steps:
1. Compile the project
2. Run the EXE program on one PC, and click the Server command button
3. Run the EXE program on another PC, and click the Client command button
4. Enter the name of the PC that is running the Server form. (This appears after
the @ sign on the Server form's caption)
5. Click Connect on the Client form.
6. Enter some text into the Send text box on the Client form, and click Send
7. Run back to the PC running the Server form (!), and you should see the text
you entered in the Receive textbox.
8. Try sending some text from the Server form
9. Pat yourself on the back for learning the basics of the WinSock control!
If you have had any problems creating this example program, you can download it by clicking here.
Comments