in reply to Client Server Communication. How to accept data sent by the server?
And the server accepts connections, reads the requests, handles them, then sends back data:print $server "FOO request\n"; my $response = <$server>; # or my $bytes_read = read($server, $response, 4192); # or whatever--basically, just read from the server
This is very dumbed-down, but it gets across the general idea, I think. Is that what you were asking?my $client = $server->accept; my $request = <$client>; # do something with the request # generate a response print $client $response; close $client;
|
|---|