in reply to Re: Socket recv?
in thread Socket recv?

Like this?
....... print "\nEnter a string to send to SIP: "; $string=<STDIN>; chomp($string); print $socket $string; #$socket->send($string."\n"); #$socket->recv($data,1024); #print $data; print <$socket>;
Its the same result!

Replies are listed 'Best First'.
Re^3: Socket recv?
by Corion (Patriarch) on Mar 11, 2011 at 21:24 UTC

    I don't know - I would imagine that you will need to look at what gets send over the wire to know what your server responds. Also look at Net::SIP if you're actually doing SIP.

      The SIP is a TLA for the server name not the SIP protocol!!

      I am using strict in my code, I should have posted that too.

      What do you mean checking return values, I thought that is what I am doing print the recv value?

      And I am not sure what you mean by closing the socket. I am not closing the socket, as far as I can see!
        The return values are different from the values the parameters are set to. For example, if you look here, you will see that
        $socket->send ("example"\n");
        really should be:
        my $retval = $socket->send("example\n"); # make sure $retval is defined, and contains the length of the strin +g
        ditto for the recv call.

        As for closing the socket, I understand that *you* are not closing it, but there are 2 sides to every connection :).