Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pb using Winsock in UDP
Message
From
07/08/2002 04:14:53
 
 
To
06/08/2002 15:58:30
Roman Segaud
Laboratoires Fortepharma
Nice, France
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00686108
Message ID:
00686915
Views:
33
Here is example:

On the new form put two WinSock controls (OleControl1 and OleControl2) and two command buttons (Command1 and Command2). Set the following properties:

OleControl1:

LocalPort = 1000
Protocol = 1 - UDP Protocol
RemoteHost = 127.0.0.1
RemotePort = 1001

OleControl2:

LocalPort = 1001
Protocol = 1 - UDP Protocol
RemoteHost = 127.0.0.1
RemotePort = 1000

The code:

Forms Init:
thisform.olecontrol1.bind
thisform.olecontrol2.bind
Command1 Click:
thisform.olecontrol1.sendData("Hello from OleControl1")
Command2 Click:
thisform.olecontrol2.sendData("Hello from OleControl2")
OleControl1 DataArrival:
Debug
susp
a = ""
this.getData(@a)
a = a
OleControl2 DataArrival:
Debug
susp
b = ""
this.getData(@b)
b = b
In DataArrival events I put debug/susp to trace this code line by line (rows a = a and b = b is to execute previous row (with GetData) and stay into event code). When you click on the command button, in other OleControl will be raised DataArrival event and you can see how data is received through UDP.

Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000)

VB (.NET) - what other language do you need in the whole Universe?...

Previous
Next
Reply
Map
View

Click here to load this message in the networking platform