[gnet] Get Remote IP address from a GTcpSocket



Hello everyone,

Is there a way to get the remote IP address in canonical form (dotted string) from a GTcpSocket ?

I currently do -

GTcpSocket *socket;
...
gnet_inetaddr_get_canonical_name(gnet_tcp_socket_get_remote_inetaddr(socket))
...

Often this is not properly null terminated and has trailing characters. Is there a better way?

GConn->hostname was perfect but I dont use GConns anymore.

Thanks for your time~
-G





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]