Hi,

is it possible to get these information before a client connect - on server
startup? because I need it to know where to connect my client. LocalIPList
gives me several adresses even Virtual IP adapters :-(.

Thank you and best regards


2014-08-05 11:07 GMT+02:00 Angus Robertson - Magenta Systems Ltd <
an...@magsys.co.uk>:

> > how can I find out the local IP Adress that is used by the
> > HttpAppServer?
>
> In event BeforeProcessRequest:
>
> var
>     SocketServer: TWSocketServer;
>     ListenItem: TWSocketMultiListenItem;
> begin
> xx
>
> SocketServer := TWSocketServer ((Sender as THttpServer).WSocketServer);
> if SocketServer.MultiListenIndex = -1 then begin
>     RemoteClient.CServerAddr := SocketServer.GetXAddr ;
>     RemoteClient.CServerPort := SocketServer.Port ;
> end
> else begin
>     ListenItem := SocketServer.MultiListenSockets
>                                 [SocketServer.MultiListenIndex] ;
>     RemoteClient.CServerAddr := ListenItem.Addr ;
>     RemoteClient.CServerPort := ListenItem.Port ;
> end ;
>
> If you are not using Multilisten, ignore that code.
>
> Angus
>
> --
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to