public class UnicastTestTcpSlow
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
protected class |
UnicastTestTcpSlow.Acceptor |
限定符和类型 | 字段和说明 |
---|---|
protected UnicastTestTcpSlow.Acceptor |
acceptor |
protected java.util.concurrent.atomic.AtomicLong |
current_value |
protected static byte |
DATA |
protected boolean |
dont_bundle |
protected java.net.InetSocketAddress |
local |
protected int |
msg_size |
protected long |
msgs_per_sec |
protected int |
num_msgs |
protected int |
num_threads |
protected boolean |
oob |
protected java.io.DataOutputStream |
output |
protected java.util.concurrent.locks.Lock |
output_lock |
protected long |
print |
protected java.net.InetSocketAddress |
remote |
protected java.net.Socket |
sock |
protected static int |
SOCK_RECV_BUF_SIZE |
protected static int |
SOCK_SEND_BUF_SIZE |
protected java.net.ServerSocket |
srv_sock |
protected long |
start |
protected static byte |
START |
protected long |
stop |
protected static boolean |
TCP_NODELAY |
protected java.util.concurrent.atomic.AtomicLong |
total_bytes |
protected long |
total_time |
构造器和说明 |
---|
UnicastTestTcpSlow() |
protected boolean oob
protected boolean dont_bundle
protected int num_threads
protected int num_msgs
protected int msg_size
protected java.net.InetSocketAddress local
protected java.net.InetSocketAddress remote
protected java.net.Socket sock
protected java.io.DataOutputStream output
protected final java.util.concurrent.locks.Lock output_lock
protected java.net.ServerSocket srv_sock
protected UnicastTestTcpSlow.Acceptor acceptor
protected long start
protected long stop
protected long total_time
protected long msgs_per_sec
protected long print
protected java.util.concurrent.atomic.AtomicLong current_value
protected java.util.concurrent.atomic.AtomicLong total_bytes
protected static final boolean TCP_NODELAY
protected static final int SOCK_SEND_BUF_SIZE
protected static final int SOCK_RECV_BUF_SIZE
protected static final byte START
protected static final byte DATA
public void init(java.lang.String local_addr, java.lang.String remote_addr, int local_port, int remote_port) throws java.lang.Exception
java.lang.Exception
public void eventLoop() throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] args)
public void receive(Message msg)
protected static Message readMessage(byte[] buf, int offset, int length) throws java.lang.Exception
java.lang.Exception