hmmm...bad news for me then. The perl client is simple. It doesn't use IO::Socket.
#!/usr/bin/perl -w
use strict;
# simple client
use Socket;
use IO::Handle;
socket(TSOCK, PF_UNIX, SOCK_STREAM,0);
connect(TSOCK, sockaddr_un("/tmp/testsock")) or print "ERROR!";
while (defined(my $messg = <TSOCK>)) {
print $messg;
print TSOCK "Hello server!\n";
TSOCK->flush;
}
Both servers work fine with their counter-part (but I wrote them to do that). I haven't tried to change anything to debug the "c<->perl" problem, because I have a hard time understanding what could be wrong (they are just exchanging strings) and thought I would ask here to find out if there is something I'm unaware of.
If I connect the above perl client to the c server, it accepts a new connection, but it does not recieve the "Hello", and the client does not recieve messages from the server.
What could go wrong, considering the c server works fine with connections to other c programs? | [reply] [d/l] |
What string does the C server send after it accepts the connection? It does have a newline in it, right?
| [reply] |
A NEWLINE!!!
What's wrong with a good ol' fashioned "null terminator"?!!?
wow...thanks.
| [reply] |