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
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