Re: [xSocket-develop] issue on INonBlockingConnection getremoteaddress
Status: Inactive
Brought to you by:
grro
|
From: Gregor R. <gre...@gm...> - 2010-09-26 07:46:01
|
Hi,
would you please send a small runnable version of your server to reproduce this behaviour
Gregor
----- Original Message -----
From: 王登
Sent: 09/23/10 07:43 AM
To: xso...@li...
Subject: [xSocket-develop] issue on INonBlockingConnection getremoteaddress
i can not get the remote ip address, except the java.lang.NullPointerException.
the handle code is below:
public boolean onConnect(INonBlockingConnection connection) throws IOException {
String remoteip = connection.getRemoteAddress().getHostAddress();//NullPointerException here
...
}
the client code is below(writen in python):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(HOST, PORT)
s.send(DATA)
#time.sleep(1) if i add this line, i can get the correct remote ip address.
s.close()
|