Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Winsock Opens TCP port instead of UDP port
Message
From
05/10/2004 12:06:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Winsock Opens TCP port instead of UDP port
Miscellaneous
Thread ID:
00948827
Message ID:
00948827
Views:
81
Hi,

I am trying to add an mswinsock OLE control to a form programatically and for some reason the port always opens as TCP instead of UDP.

I have defined the following class:
DEFINE CLASS UDPCtrl AS OLEControl
   OleClass	= 'mswinsock.winsock'
   Protocol	= 1			&& UDP
	
   PROCEDURE Init
   LPARAMETERS lnLocalPort, lcRemoteHost, lnRemotePort
      This.RemoteHost	= lcRemoteHost
      This.RemotePort	= lnRemotePort
		
      This.Bind(lnLocalPort)
   ENDPROC	
ENDDEFINE
In the command window, I do the following:
loForm = CREATEOBJECT("Form")
loForm.Show()
loForm.AddObject("oUDP1", "UDPCtrl", 2050, "127.0.0.1", 2051)

Now, if I run a "netstat -a" at a DOS prompt, I see a TCP port 2050 open. How come it's not UDP.

If I drop the mswinsock OLE on a form, setting the same properties and Init code, it opens a UDP port.

Thanks,
Paul
Next
Reply
Map
View

Click here to load this message in the networking platform