About my own socket protocol I downloaded, I can't correctly use Socket.Connect to connect to a local network IP. Is this where Socket.Bind should be used?
Printable View
About my own socket protocol I downloaded, I can't correctly use Socket.Connect to connect to a local network IP. Is this where Socket.Bind should be used?
I use .Bind only for UDP-connections not for TCP!
It IS a UDP connection. Now, when should it be used?Quote:
Originally Posted by opus
As far as I know, Bind is used to accept connections / data only on a given network interface. By default it is bound to 0.0.0.0 meaning it accepts from any network interface: loopback, LAN, or internet, but you can bind it to a given network interface
Like Opus said, I use it on UDP server programs. I think of it like UDP's version of Winsock.Listen (which is used for TCP).
You can use it like:
Code:Winsock.Bind Winsock.LocalIP, PortNumberHere
Bind has more to do with reserving a port number to one socket than anything else. The secondary function is to tie a socket to one adapter.
This is all pretty well covered in the VB6 documentation.