/**
   * Creates new ServerSession.
   *
   * @param trans the connection to the client
   * @param handler the event listener that will process requests
   * @param auth the authenticator to use with this connection
   * @throws IOException if an error occurred while opening the input and output streams
   */
  public ServerSession(ObexTransport trans, ServerRequestHandler handler, Authenticator auth)
      throws IOException {
    mAuthenticator = auth;
    mTransport = trans;
    mInput = mTransport.openInputStream();
    mOutput = mTransport.openOutputStream();
    mListener = handler;
    mMaxPacketLength = 256;

    mClosed = false;
    mProcessThread = new Thread(this);
    mProcessThread.start();

    mData = new ObexByteBuffer(32);
    mHeaderBuffer = new ObexByteBuffer(32);
  }