in reply to Sock-Server and Sock-Client

Umm, that looks a little confused. Your server only needs to listen to one (local) IP and port, which the clients then connect to, thats the point of it being a server. (Unless I misunderstood what you are trying to do).
For an example of doing that and looping indefinitely, see Re: Daemons in Perl, and just add:
$x-add(\*STDIN);
and:
if($handle == \*STDIN) ..
in appropriate places to be able to read from the command line and stop the program when a key is pressed.
And fill in the parse_external_command sub to deal with data from the client.

C.

Replies are listed 'Best First'.
Re: Re: Sock-Server and Sock-Client
by rupesh (Hermit) on Apr 16, 2003 at 12:55 UTC
    My first problem is this:
    how do i write back to the client from the server, which is running indefenitely?
    And Yes, the server listens to only one client...
      You just print to the socket you accepted. It's two-way.. So in your example, that would be:
      print $new_sock "Hallo!\n";
      I'm not sure what you mean by only listening to one client, I meant one IP/Port pair.

      C.

        hi,
        I'm able to write to the server once the client is established the connection,
        but i'm not able to tell the client something from the server...I suppose the client also should be listening indefenitely to the server right?
        If not, plz. advice...
        Thanks.