Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Winsock
Message
From
22/04/1999 13:14:42
 
 
To
21/04/1999 06:13:15
General information
Forum:
Visual Basic
Category:
Other
Title:
Miscellaneous
Thread ID:
00210447
Message ID:
00211139
Views:
49
The Winsock control let you connect to a remote machine and exchange data using DCP or TCP.

In order to connect you must supply a Protocol type.
(For the example I assume that you have called the control Winsock1)
Winsock1.Protocol = sckTCPProtocol (or sckUDPProtocol)

You must decide which computer will be the server and which is the client
Sub Form1_Init
'(Server Side)
Winsock1.LocalPort
Winsock1.Listen
End Sub
-----------------
Sub Form1_Init
'(Client side)
'To connect to a remote computer you must now its IP or its name
Winsock1.RemoteHost = "Remote Computer Name"
Winsock1.RemotePort = 1001
End Sub

Private Sub Command1_Click
'Command button to connect to the server
Winsock1.Connect
End Sub

The Winsock control has a method called Connection_Request where you normally have to accept the connection requested:
Private Sub Winsock1_ConnectionRequest(...)

End Sub
Previous
Reply
Map
View

Click here to load this message in the networking platform