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
573 B
26 lines
573 B
package core.thrift;
|
|
|
|
import org.apache.thrift.TServiceClient;
|
|
import org.apache.thrift.transport.TSocket;
|
|
|
|
import java.net.Socket;
|
|
|
|
public class TSocketPool extends TTransportPool<TSocket,TServiceClient>{
|
|
|
|
|
|
public TSocketPool(String ip, Integer port, Integer timeout) {
|
|
super(ip, port, timeout);
|
|
}
|
|
|
|
@Override
|
|
public Socket socket(TSocket o) {
|
|
return o.getSocket();
|
|
}
|
|
|
|
@Override
|
|
public TSocket create() throws Exception {
|
|
TSocket socket=new TSocket(ip,port,timeout);
|
|
socket.open();
|
|
return socket;
|
|
}
|
|
}
|
|
|