Java 类com.facebook.thrift.protocol.TProtocol 实例源码

项目:buck    文件:ReconnectingEdenClient.java   
/** @param socketFile to connect to when creating a Thrift client. */
ReconnectingEdenClient(final Path socketFile, Clock clock) {
  this(
      () -> {
        // Creates a new EdenService.Client by creating a new connection via the socketFile.
        UnixDomainSocket socket = UnixDomainSocket.createSocketWithPath(socketFile);
        TTransport transport = new TSocket(socket);
        // No need to invoke transport.open() because the UnixDomainSocket is already connected.
        TProtocol protocol = new TBinaryProtocol(transport);
        return new EdenService.Client(protocol);
      },
      clock);
}