RpcStreamConnection extends RpcConnection { private void initSocketBasedServer() throws ConnectionException { try { if (isNull(socket)) { if (nonNull(pool)) { socket = pool.acquire(); } else { socket = RpcSocketHelper.createSocket(hostName, hostPort, props, secure); } } } catch (UnknownHostException exc) { throwConnectionException(exc, "Unable to resolve Perforce server host name '%s' for RPC connection", hostName); } catch (IOException exc) { throwConnectionException(exc, "Unable to connect to Perforce server at %s:%s", hostName, hostPort); } catch (Throwable thr) { Log.error("Unexpected exception: %s", thr.getLocalizedMessage()); Log.exception(thr); throwConnectionException(thr); } getIpAddressFromSocketConnection(); if (secure) { initSSL(); } initRpcSocketInputAndOutputStreamIfSocketBasedServer(); } RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, RpcSocketPool pool);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, RpcSocketPool pool, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket, RpcSocketPool pool, boolean secure);  RpcStreamConnection(String serverHost, int serverPort, Properties props,
            ServerStats stats, Charset charset, Socket socket, RpcSocketPool pool, boolean secure,
            String rsh); String getServerIpPort(); String getClientIpPort(); void disconnect(final RpcPacketDispatcher dispatcher); RpcPacket getRpcPacket(); RpcPacket getRpcPacket(final RpcPacketFieldRule fieldRule,
            final IFilterCallback filterCallback); int getSystemRecvBufferSize(); int getSystemSendBufferSize(); long putRpcPackets(@Nonnull RpcPacket[] packets); long putRpcPacket(@Nonnull RpcPacket packet); @Override void useConnectionCompression(); static final String TRACE_PREFIX; }
@Test public void initSocketBasedServer() throws NoSuchMethodException { Method initSocketBasedServer = getPrivateMethod(RpcStreamConnection.class, "initSocketBasedServer"); try { initSocketBasedServer.invoke(mockConnection); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { fail(e.getMessage()); } }