Sabacthani has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use IO::Socket; $rsock = new IO::Socket::INET (PeerAddr => 'blah', PeerPort=> 1234, Proto => 'tcp', ); die "Remote socket could not be created: $!\n" unless $rsock; $str[0]="\002"; $str[1] = unpack("B*", pack("N", 47)); $str[2] = unpack("B*", pack("N", 12)); $str[3] = unpack("B*", pack("N",76)); $str[4] = unpack("B*", pack("N", 1)); $str[5] = unpack("B*", pack("N", 0)); $str[6] = unpack("B*", pack("N", 1)); $header=join('',@str); $header=$header."LOGON USERNAME=NAME PASSWORD=PASS\0"; print $rsock $header; #syswrite($rsock,$header,47); # Print, or syswrite? Neither seem to help... while (<$rsock>) { last unless /\S/; chomp; print; } # Returns Error: Ileagle message size in header
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Socket Newbie (perl newbie, too...)
by btrott (Parson) on Jun 18, 2001 at 22:29 UTC | |
|
Re: Socket Newbie (perl newbie, too...)
by damian1301 (Curate) on Jun 18, 2001 at 22:31 UTC | |
|
Re: Socket Newbie (perl newbie, too...)
by wog (Curate) on Jun 18, 2001 at 22:20 UTC | |
|
Re: Socket Newbie (perl newbie, too...)
by Anonymous Monk on Jun 18, 2001 at 23:19 UTC |