// Path: flume-core/src/main/java/com/cloudera/flume/handlers/thrift/TBufferedSocket.java
// public class TBufferedSocket extends TSocket {
// 
//   public TBufferedSocket(Socket socket) throws TTransportException {
//     super(socket);
//     wrapStreams();
//   }
// 
//   public TBufferedSocket(String host, int port, int timeout) {
//     super(host, port, timeout);
//     wrapStreams();
//   }
// 
//   public TBufferedSocket(String host, int port) {
//     super(host, port);
//     wrapStreams();
//   }
// 
//   @Override
//   public void open() throws TTransportException {
//     super.open();
//     wrapStreams();
//   }
// 
//   private void wrapStreams() {
//     if (!isOpen() || inputStream_ == null) {
//       return;
//     }
//     inputStream_ = new BufferedInputStream(inputStream_);
//     outputStream_ = new BufferedOutputStream(outputStream_);
//   }
// 
// }


import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cloudera.flume.handlers.thrift.TBufferedSocket;
      serverSocket_.setReuseAddress(true);
      // Bind to listening port
      serverSocket_.bind(bindAddr);
    } catch (IOException ioe) {
      serverSocket_ = null;
      throw new TTransportException("Could not create ServerSocket on address "
          + bindAddr.toString() + ".");
    }
  }

  public void listen() throws TTransportException {
    bind();

    // Make sure not to block on accept
    if (serverSocket_ != null) {
      try {
        serverSocket_.setSoTimeout(0);
      } catch (SocketException sx) {
        LOGGER.error("Could not set socket timeout.", sx);
      }
    }
  }

  protected TTransport acceptImpl() throws TTransportException {
    if (serverSocket_ == null) {
      throw new TTransportException(TTransportException.NOT_OPEN,
          "No underlying server socket.");
    }
    try {
      Socket result = serverSocket_.accept();
// Path: flume-core/src/main/java/com/cloudera/flume/handlers/thrift/TBufferedSocket.java
// public class TBufferedSocket extends TSocket {
// 
//   public TBufferedSocket(Socket socket) throws TTransportException {
//     super(socket);
//     wrapStreams();
//   }
// 
//   public TBufferedSocket(String host, int port, int timeout) {
//     super(host, port, timeout);
//     wrapStreams();
//   }
// 
//   public TBufferedSocket(String host, int port) {
//     super(host, port);
//     wrapStreams();
//   }
// 
//   @Override
//   public void open() throws TTransportException {
//     super.open();
//     wrapStreams();
//   }
// 
//   private void wrapStreams() {
//     if (!isOpen() || inputStream_ == null) {
//       return;
//     }
//     inputStream_ = new BufferedInputStream(inputStream_);
//     outputStream_ = new BufferedOutputStream(outputStream_);
//   }
// 
// }


// Path: flume-core/src/main/java/org/apache/thrift/transport/TSaneServerSocket.java
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cloudera.flume.handlers.thrift.TBufferedSocket;

      serverSocket_.setReuseAddress(true);
      // Bind to listening port
      serverSocket_.bind(bindAddr);
    } catch (IOException ioe) {
      serverSocket_ = null;
      throw new TTransportException("Could not create ServerSocket on address "
          + bindAddr.toString() + ".");
    }
  }

  public void listen() throws TTransportException {
    bind();

    // Make sure not to block on accept
    if (serverSocket_ != null) {
      try {
        serverSocket_.setSoTimeout(0);
      } catch (SocketException sx) {
        LOGGER.error("Could not set socket timeout.", sx);
      }
    }
  }

  protected TTransport acceptImpl() throws TTransportException {
    if (serverSocket_ == null) {
      throw new TTransportException(TTransportException.NOT_OPEN,
          "No underlying server socket.");
    }
    try {
      Socket result = serverSocket_.accept();
      TSocket result2 = new TBufferedSocket(result);