Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Winsock
Message
De
22/04/1999 13:14:42
 
 
À
21/04/1999 06:13:15
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00210447
Message ID:
00211139
Vues:
50
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform