|
From: <cc...@ma...> - 2006-04-02 00:21:38
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[please Cc me again]
Hi,
I'm not sure I understand the usage of lo_send_from(). When sending from
a TCP server, it gives errors ("Broken pipe"). When send_data() chooses
which file descriptor to write the data to, it uses from->socket if from
is not NULL. But (for TCP sockets) from->socket is in a LISTENING state
(ie. (it should be) blocked on accept()), so writing data into it makes
not much sense. connect() should be called first, but it would result in
an error ("Transport endpoint is already connected"). Or, we could
create a new socket, bind() it to the same port as the server is bound
to... Ooops, the server is already bound to that port. :-S What about
completely disabling lo_send_from() for TCP servers? :'(
Shouldn't be there a check in send_data() to make sure protocol of the
"from" server matches the protocol specified in the target address?
If someone has time, please play around with this to confirm my experiences.
Simple test case attached. Which shows a(nother) bug:
lo_message_get_source() returns "empty" addresses for TCP sources when
called from a method handler (or maybe from other places, too). Changing
both protocols to UDP makes everything work fine.
Thanks, bye
- --
Szabolcs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFELxkBGJRwVVqzMkMRAiibAJ9KL+5Tk+qtOoq3y5Lpn8rdU09CdwCfaaFY
8Wh8nTWpOjHZZrrcG1evx20=
=bzDv
-----END PGP SIGNATURE-----
|