Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VB6 Winsock UDP server port binding problem

280 views
Skip to first unread message

ri...@mbari.org

unread,
Mar 27, 2001, 6:44:05 PM3/27/01
to
I am trying to create a VB6.0 server to send UDP datagrams to clients
requesting info. The info is the most recent position (lat/lon) read in a
serial port from a handheld GPS receiver). I want to use a a known port on
the server side - eg 4001. And a default port on the clients

I have the VB6 winsock control of the server set to:
MyServerWinsock1.Protocol = sckUDPProtocol
MyServerWinsock1.RemoteHost = "localhost"
MyServerWinsock1.Bind = 4001

At the client:

MyClientWinsock1.Protocol = sckUDPProtocol
MyClientWinsock1.RemoteHost = "localhost"
MyClientWinsock1.RemotePort = 4001


The client does a "senddata" to its socket every few seconds on a timer
when
it wants the data. The server responds by sending it's last good GPS fix
data out vis a senddata on its port.

This all works great until I stop and restart the client or if I try to run
multiple clients. The server fails to respond to any requests until I kill
and restart it.

I dont think I want a broadcast and I dont think I need to establish a TCP
connection. I just want the server to send its short message to any client
that is interested. What am I doing wrong?

Thanks in advance.
Rich Schramm

----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email ab...@newsone.net

Robin Shen

unread,
Mar 30, 2001, 6:29:24 AM3/30/01
to
Hi Rich,

UDP is connection less protocol and their relationship are peer to peer.
Generally, we need set the server computer's LocalPort property. The client
computer then needs only to set the RemoteHost to the Internet address of
the server computer, and the RemotePort property to the same port as the
server computer's LocalPort property.

However, if you want to use your application with multiple clients, please
set these properties before you use the senddata. Please reference the
article Q192564 for detailed information. You can also get it from
http://support.microsoft.com/support/kb/articles/Q192/5/64.ASP.

Hope this helps,

Robin
robin...@microsoft.com

0 new messages