T
Tompyna
Hi All,
I am very much new to socket programming in perl. I had written
a small socket client and server program to send and receive a string
value.
my $msg = "hello";
send(SOCKET,$msg,10,MSG_OOB ) ----- > will send the string "hello".
With the above code i was able to send an string value, and receive
the value in the client.Now my starts here.... .
But if i need to send an integer. i tried sending by giving
my $msg = 10;
$Returned_val = send(SOCKET,$msg,4,MSG_OOB );
print "\nNo: of characters send '",$Returnned_val,"'";
This will take 10 as string value and send it.
Because the printed Returned_val == 2 , and not 4 .
Can anyone suggest any way to send an integer value through sockets in
perl?.
Thanx.... in advance.
Thomas Poly.
I am very much new to socket programming in perl. I had written
a small socket client and server program to send and receive a string
value.
my $msg = "hello";
send(SOCKET,$msg,10,MSG_OOB ) ----- > will send the string "hello".
With the above code i was able to send an string value, and receive
the value in the client.Now my starts here.... .
But if i need to send an integer. i tried sending by giving
my $msg = 10;
$Returned_val = send(SOCKET,$msg,4,MSG_OOB );
print "\nNo: of characters send '",$Returnned_val,"'";
This will take 10 as string value and send it.
Because the printed Returned_val == 2 , and not 4 .
Can anyone suggest any way to send an integer value through sockets in
perl?.
Thanx.... in advance.
Thomas Poly.