/** * Initializes the connection, including connecting to socket or shared memory endpoint * * @throws TransportException if initialization fails */ public void initialize() throws TransportException { // Initialize transport (connect socket, e.g.) _transport.initialize(); // Do handshake try { _inStream = new DataInputStream(_transport.getInputStream()); _outStream = new DataOutputStream(_transport.getOutputStream()); _doHandshake(); } catch (IOException ioe) { throw new TransportException(ioe); } }
/** Sets up the transports for the given XMPPConnection */ private void prepareConnection(final Connection connection) { assert (this.connection == null); initTransports(); this.connection = connection; this.currentLocalJID = new JID(connection.getUser()); connectionPool.open(); for (ITransport transport : availableTransports) { transport.initialize(connection, byteStreamConnectionListener); } }