Carl,

In the handler for the SuccessEvent coming from your SocketFactory...

For your Reference:

    Socket_Handle         = @_[ARG0];
    IADDR                     = @_[ARG1];
    Remote_Port            = @_[ARG2];
    SocketFactoryID       = @_[ARG3];

You'll need to unpack the IP Address using:
   $Remote_Address = inet_ntoa($IADDR);

HTH,

Dougie!


In a message dated 7/24/03 7:23:18 AM Eastern Daylight Time, [EMAIL PROTECTED] 
writes:
Hi,

it's the first time that I've used POE (based on its chat-server) to realize 
a 
Socket-based program that sends from a 'studio' to all listening clients the 
same data (lines).

That works so far,
but now I'd like the server to know which ip-addr are allowed to conntect and 
which are to reject.

Please give me a hint how can I get th IP-Addr. of the connecting client in 
this function (of the chat-server):

sub client_connected {
    my $session_id = $_[SESSION]->ID;
    $users{$session_id} = 1;
    broadcast( \%studio, $session_id, "1 Client connected." );
}

Thanks,
Carl

Reply via email to