stickleprojects Level: Moderator

 Registered: 09-09-2002 Posts: 891
|
Re: Help with Winsock
Hi 8RaM.
I have coded a simple client/server winsock application for you.
Start the server, then the client.
Enter your messgae on the client and click send. You can send messages to/from the server and client.
Important point to note is that the WinSock control is a control-array. The new items are added on the server instance of the form on a connectionrequest event.
This code is demonstrated in the MSDN.
For information only, I have added a listbox of connected clients to the form. You could extend this to allow direction of the messgaes from the server to the client.
Another note would be that this sample supports multiple connections to a single server, however, the clients cannot speak to each other.
Hope this helps as a starter.
Kieron
BTW. To add a winsock, select "Add Component" from the project menu, choose Microsoft Winsock Control and drop it on your form.
Cheers
____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)
____________________________ Attached:
winsockdemo.zip 5 KB (Downloads: 18)
|