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

Comm library problem? (with -listen 0 and multiple IP addresses)

4 views
Skip to first unread message

nightwatch77

unread,
Apr 3, 2007, 5:17:15 PM4/3/07
to
Hello,

I am experimenting with the comm library and found a problem when
using comm on localhost with network IP and hostname assigned: when
two localhost clients connect to the same interpreter (lets assume it
runs on port 8080), but one client is using an id of {8080 localhost}
and the second client is using an id of {8080 <network hostname>} and
both clients are configured to use -listen 0, the client IDs are
identical on the server.
It happens because comm determines that both IP addresses refer to the
same local machine and as a results the hostname is removed from comm
ID and only client port number is left. But the -local 0 option of
client comm channel configuration results in client port number being
0 in both clients. And as a results both client connections get ID="0"
and it is not possible to tell which client has sent the command.
Example code:
client 1
comm::comm config -listen 0
comm::comm send {8080 localhost} {puts "client 1"}

client 2
comm::comm config -listen 0
comm::comm send {8080 mymachine} {puts "client 2"}

Do you have any way of handling this case? How can I tell which client
is sending the comand?

Best Regards
RG

0 new messages