By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,317 Members | 2,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,317 IT Pros & Developers. It's quick & easy.

Perl socket programming

P: 2
Hi all,

After reading for a while I have successfully prepared a server side listening and accepting multiple connections, and a client connecting to server.
I need help on loop of send/receive data and passing it over to other part of program to process/store it then send back the output/new request.

These are the steps I want in the communication.
Steps in making socket and sending receiving data from socket, making a complete continuous to and from data transfer program.

On server side
Make a socket, bind IP and port number together.
Start listening on socket.
Make new connection/socket for each client.
Get into a continuous loop for reading/writing data with the client -
Read data from socket sent by client. Process it for output by other part of the program.
Write output on socket to send to client.
Wait for clients data input and send it to processing.

On client side
Make a socket, bind IP and port.
Connect to server.
Write data on socket to send it to server, Request.
Wait for server reply, read data from socket sent by server.
Process the data by other part of program.
Write data on socket, processed output or any new request.
Wait for server reply.

Can any one demonstrate how to complete these steps in Perl?

Thanks
Sep 24 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.