Hello Errto,
Thanks for your last suggestions I have implemented all that you said but it really did not help, to resolve the issue. It's still hanging...
sub host_to_user {
+
my $nread ;
my $inp ;
$/ = CRLF ;
while (<$socket>) {
chomp;
+ my @data = split/-/, $_ ;
print $_ , "\n";
print "The first value is $data[1]\n";
if ($data[1] eq 'THISISTHEEND') {
$socket->close ;
print " I have executed the close\n";
return 0 ;
}
} #
+ $socket->close ; #<- position 2
###print " I have executed the close\n";
# return ;
}
The output is still the same the following is the output of the above code.
$ ./client
Testing> Hello
I have received your message[server]-THISISTHEEND
The first value is THISISTHEEND
I have executed the close
Testing> So what
^C$
$
I even tried to put the $socket->close () in what I mentioned as position 2, but that was worse and the execution never got to the close section so I took it out. |