You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
617 B
26 lines
617 B
package core.thrift;
|
|
|
|
import org.apache.thrift.async.TAsyncClient;
|
|
import org.apache.thrift.transport.TNonblockingSocket;
|
|
|
|
import java.net.Socket;
|
|
|
|
public class TNonblockingSocketPool extends TTransportPool<TNonblockingSocket,TAsyncClient> {
|
|
|
|
|
|
public TNonblockingSocketPool(String ip, Integer port, Integer timeout) {
|
|
super(ip, port, timeout);
|
|
}
|
|
|
|
@Override
|
|
public Socket socket(TNonblockingSocket o) {
|
|
return o.getSocketChannel().socket();
|
|
}
|
|
|
|
@Override
|
|
public TNonblockingSocket create() throws Exception {
|
|
return new TNonblockingSocket(ip,port,timeout);
|
|
}
|
|
|
|
|
|
}
|
|
|