i've just look at the TNonBlockingServerSocket and found its hard to put the
client ip out.
protected TNonblockingSocket acceptImpl() throws TTransportException {
if (serverSocket_ == null) {
throw new TTransportException(TTransportException.NOT_OPEN, "No
underlying server socket.");
}
try {
SocketChannel socketChannel = serverSocketChannel.accept();
if (socketChannel == null) {
return null;
}
// here, how can i get the socketChannel, that seems its best the way
by event flowing...
TNonblockingSocket tsocket = new TNonblockingSocket(socketChannel);
tsocket.setTimeout(clientTimeout_);
return tsocket;
} catch (IOException iox) {
throw new TTransportException(iox);
}
}
On 2011-10-24, at 上午10:39, Mike Riley wrote:
> It looks like subclassing TServerSocket/TNonBlockingServerSocket (and
> your chosen server class) will allow you to access the IP address (or
> hostname) pretty easily right from the Sockets they manage so that's
> what you're shooting for I guess...
>
> On Sun, Oct 23, 2011 at 10:15 PM, stream <[email protected]> wrote:
>> well, is my fault ,not clear the description .
>> the library is Java... thank Mike firstly...
>>
>> On 2011-10-24, at 上午9:20, Mike Riley wrote:
>>
>>> plac
>>
>>