|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.perforce.p4java.impl.mapbased.rpc.connection.RpcConnection
com.perforce.p4java.impl.mapbased.rpc.stream.RpcStreamConnection
public class RpcStreamConnection
Socket stream I/O based implementation of the RpcConnection class.
The implementation here uses a small stack of input and output streams based on socket streams at the lowest level, with (at least) an optional connection compression stream on top of that layer, and with charset conversion where necessary.
| Field Summary | |
|---|---|
protected static int |
INITIAL_SENDBUF_SIZE
Number of bytes we allocate for initial byte arrays for sending RPC packets. |
protected static int |
SENDBUF_REALLOC_INCR
When we run out of send buffer space in putPacket, we allocate another, larger, buffer; this constant determines how much larger than the existing buffer the new one should be, or, alternatively, how much bigger than the incoming field length the new buffer should be. |
static String |
TRACE_PREFIX
|
| Fields inherited from class com.perforce.p4java.impl.mapbased.rpc.connection.RpcConnection |
|---|
clientCharset, flowController, hostName, hostPort, isUnicodeServer, NON_UNICODE_SERVER_CHARSET, NON_UNICODE_SERVER_CHARSET_NAME, props, stats, UNICODE_SERVER_CHARSET, UNICODE_SERVER_CHARSET_NAME, usingCompression |
| Constructor Summary | |
|---|---|
RpcStreamConnection(String serverHost,
int serverPort,
Properties props,
ServerStats stats,
Charset charset)
Construct a new Perforce RPC connection to the named Perforce server using java.io socket streams at the lowest level. |
|
RpcStreamConnection(String serverHost,
int serverPort,
Properties props,
ServerStats stats,
Charset charset,
RpcSocketPool pool)
Construct a new Perforce RPC connection to the named Perforce server using java.io socket streams at the lowest level. |
|
RpcStreamConnection(String serverHost,
int serverPort,
Properties props,
ServerStats stats,
Charset charset,
Socket socket)
Construct a new Perforce RPC connection to the named Perforce server using java.io socket streams at the lowest level. |
|
| Method Summary | |
|---|---|
void |
disconnect(RpcPacketDispatcher dispatcher)
Disconnect this server. |
RpcPacket |
getRpcPacket()
Get a Perforce RPC packet from the underlying stream. |
int |
getSystemRecvBufferSize()
Return the system (i.e. |
int |
getSystemSendBufferSize()
Return the system (i.e. |
long |
putRpcPacket(RpcPacket packet)
Put a Perforce RPC packet onto the output stream. |
long |
putRpcPackets(RpcPacket[] packets)
Put an array of RPC packets. |
void |
useConnectionCompression()
If called, will set this connection to use (GZIP) compression for all traffic on this connection from this point on. |
| Methods inherited from class com.perforce.p4java.impl.mapbased.rpc.connection.RpcConnection |
|---|
getClientCharset, getFlowController, getHostName, getHostPort, getNormalizedBytes, getNormalizedString, getProps, getStats, isUnicodeServer, isUsingCompression, marshalPacketField, marshalPacketValue, setClientCharset, setFlowController, setHostName, setHostPort, setProps, setStats, setUnicodeServer, setUsingCompression |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TRACE_PREFIX
protected static final int INITIAL_SENDBUF_SIZE
protected static final int SENDBUF_REALLOC_INCR
| Constructor Detail |
|---|
public RpcStreamConnection(String serverHost,
int serverPort,
Properties props,
ServerStats stats,
Charset charset)
throws ConnectionException
serverHost - serverPort - props - stats - charset -
ConnectionException
public RpcStreamConnection(String serverHost,
int serverPort,
Properties props,
ServerStats stats,
Charset charset,
Socket socket)
throws ConnectionException
serverHost - serverPort - props - stats - charset - socket -
ConnectionException
public RpcStreamConnection(String serverHost,
int serverPort,
Properties props,
ServerStats stats,
Charset charset,
RpcSocketPool pool)
throws ConnectionException
serverHost - serverPort - props - stats - charset - pool -
ConnectionException| Method Detail |
|---|
public void disconnect(RpcPacketDispatcher dispatcher)
throws ConnectionException
RpcConnection
disconnect in class RpcConnectionConnectionExceptioncom.perforce.p4java.impl.mapbased.rpc.connection.RpcConnection#disconnect()
public void useConnectionCompression()
throws ConnectionException
RpcConnection
useConnectionCompression in class RpcConnectionConnectionExceptionRpcConnection.useConnectionCompression()
public RpcPacket getRpcPacket()
throws ConnectionException
getRpcPacket in class RpcConnectionConnectionException
public long putRpcPacket(RpcPacket packet)
throws ConnectionException
putRpcPacket in class RpcConnectionConnectionException
public long putRpcPackets(RpcPacket[] packets)
throws ConnectionException
RpcConnection
putRpcPackets in class RpcConnectionConnectionExceptionRpcConnection.putRpcPackets(com.perforce.p4java.impl.mapbased.rpc.packet.RpcPacket[])public int getSystemSendBufferSize()
RpcConnection
getSystemSendBufferSize in class RpcConnectionRpcConnection.getSystemSendBufferSize()public int getSystemRecvBufferSize()
RpcConnection
getSystemRecvBufferSize in class RpcConnectionRpcConnection.getSystemRecvBufferSize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||