Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Client Server Communication. How to accept data sent by the server?

by Anonymous Monk
on Apr 05, 2000 at 22:09 UTC ( [id://6955]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

The output from a command run on the server needs to be sent to the client.

How would I make the client accept data sent by the server? need help

Originally posted as a Categorized Question.

  • Comment on Client Server Communication. How to accept data sent by the server?

Replies are listed 'Best First'.
Re: Client Server Communication. How to accept data sent by the server?
by btrott (Parson) on Apr 05, 2000 at 22:20 UTC
    Well, generally, the client writes the request to the server, then waits for a response from the server. So, in the client:
    print $server "FOO request\n"; my $response = <$server>; # or my $bytes_read = read($server, $response, 4192); # or whatever--basically, just read from the server
    And the server accepts connections, reads the requests, handles them, then sends back data:
    my $client = $server->accept; my $request = <$client>; # do something with the request # generate a response print $client $response; close $client;
    This is very dumbed-down, but it gets across the general idea, I think. Is that what you were asking?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://6955]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found