public PacketTransport createPacketTransport ( String id , URI transportURI , Settings settings ) throws PacketTransportException { String protocol = transportURI . getScheme ( ) ; if ( protocol == null ) protocol = PacketTransportType . TCP ; // Default protocol if ( protocol . equals ( PacketTransportType . TCP ) || protocol . equals ( PacketTransportType . TCPS ) ) { return new TcpPacketTransport ( id , transportURI , settings ) ; } if ( protocol . equals ( PacketTransportType . TCPNIO ) ) { return new NIOTcpPacketTransport ( id , ClientEnvironment . getMultiplexer ( ) , transportURI , settings ) ; } throw new PacketTransportException ( "Unsupported transport protocol : " + protocol ) ; }
Create a packet transport instance to handle the given URI