[xSocket-develop] issue on INonBlockingConnection getremoteaddress
Status: Inactive
Brought to you by:
grro
|
From: 王登 <lma...@gm...> - 2010-09-23 06:11:23
|
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()
|