Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Winsock Opens TCP port instead of UDP port
Message
De
05/10/2004 12:06:18
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Winsock Opens TCP port instead of UDP port
Divers
Thread ID:
00948827
Message ID:
00948827
Vues:
82
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform