in reply to Local socket model

Does your 'normative perl client' only fail when trying to connect to your C server example and not your perl server example? Have you tried this? Are you using the built-in socket/connect/etc calls, or IO::Socket? Perhaps posting a short code sample would help.

Replies are listed 'Best First'.
Re^2: Local socket model
by Anonymous Monk on Oct 07, 2008 at 13:36 UTC
    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?
      What string does the C server send after it accepts the connection? It does have a newline in it, right?
        A NEWLINE!!! What's wrong with a good ol' fashioned "null terminator"?!!? wow...thanks.