realbasic-nug
[Top] [All Lists]

Re: Important socket question

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Important socket question
From: Aaron Ballman <aaron at realsoftware dot com>
Date: Sun, 30 Mar 2003 12:59:46 -0600
What about UDP? With an external UDP-class in RB 4.5 I was able to use
more than one socket on the same port. It doesn't seem to work in RB
5...

Shooting from the hip here, since I don't have my code or notes in front of me. With UDP and TCP, you cannot bind the socket to the same port. You can attempt the bind to the same port, and if you have certain socket options turned on, it will APPEAR to work, but what really happens is one socket gets bound to the port you requested, and the other gets bound to a random port that the transport chooses. But RB doesn't set that option, so you get an error.

with UDP you can bind the sockets to different ports then send the
datagram from one port to the other simply by telling the datagram to
which port it should go.

Or they can all join the same multicast group. That way it doesn't matter what port they're bound to, they all joined the same multicast group, maybe even with SendToSelf turned on, and then they all can talk to one another on a local machine. But the above works as well.

That was my thought too, but I write this great ;-) news-downloader that
does something I don't even understand myself: it communicates through port
119 on the same server in various sockets, and they do not mind at all.

How are you determining this (like with a tcpdump or something)? Are they multicasting or unicasting? Or are they doing their sends to 127.0.0.1 all to the same port, and they all get translated to the same port? Are they using multiple protocols (like TCP and UDP)?

~Aaron


---
A searchable archive of this list is available at:
<http://support.realsoftware.com/listarchives/search.php>

Unsubscribe:
<mailto:realbasic-nug-off at lists dot realsoftware dot com>

Subscribe to the digest: <mailto:realbasic-nug-digest at lists dot realsoftware dot com>
.


<Prev in Thread] Current Thread [Next in Thread>