Assuming you meant to send a newline after the HELLO,
Side that initiates the handshake:
print $sock "HELLO 1.0"; chomp( my $greet = <$sock> ); die if $greet ne 'HELLO 1.0'; ...continue...
Side that responds to the handshake:
chomp( my $greet = <$sock> ); die if $greet ne 'HELLO 1.0'; print $sock "HELLO 1.0"; ...continue...
Without the newline, you'll need touse something other than <>. It won't return until a newline is received (by default).
In reply to Re^3: Is it possible to create a socket client and server that can send information back and forth using IO::Socket?
by ikegami
in thread Is it possible to create a socket client and server that can send information back and forth using IO::Socket?
by p4R4d0x
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |