Package org.jgroups.tests
Class UnicastTestTcpSlow
- java.lang.Object
-
- org.jgroups.tests.UnicastTestTcpSlow
-
public class UnicastTestTcpSlow extends java.lang.ObjectSame as UnicastTest, but uses pure TCP instead of JGroups
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classUnicastTestTcpSlow.Acceptorprivate classUnicastTestTcpSlow.Sender
-
Field Summary
Fields Modifier and Type Field Description protected UnicastTestTcpSlow.Acceptoracceptorprotected java.util.concurrent.atomic.AtomicLongcurrent_valueprotected static byteDATAprotected booleandont_bundleprotected java.net.InetSocketAddresslocalprotected intmsg_sizeprotected longmsgs_per_secprotected intnum_msgsprotected intnum_threadsprotected booleanoobprotected java.io.DataOutputStreamoutputprotected java.util.concurrent.locks.Lockoutput_lockprotected longprintprotected java.net.InetSocketAddressremoteprotected java.net.Socketsockprotected static intSOCK_RECV_BUF_SIZEprotected static intSOCK_SEND_BUF_SIZEprotected java.net.ServerSocketsrv_sockprotected longstartprotected static byteSTARTprotected longstopprotected static booleanTCP_NODELAYprotected java.util.concurrent.atomic.AtomicLongtotal_bytesprotected longtotal_time
-
Constructor Summary
Constructors Constructor Description UnicastTestTcpSlow()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voideventLoop()(package private) static voidhelp()voidinit(java.lang.String local_addr, java.lang.String remote_addr, int local_port, int remote_port)static voidmain(java.lang.String[] args)protected static MessagereadMessage(byte[] buf, int offset, int length)voidreceive(Message msg)(package private) voidsendMessages()(package private) voidsetMessageSize()(package private) voidsetNumMessages()(package private) voidsetSenderThreads()
-
-
-
Field Detail
-
oob
protected boolean oob
-
dont_bundle
protected boolean dont_bundle
-
num_threads
protected int num_threads
-
num_msgs
protected int num_msgs
-
msg_size
protected int msg_size
-
local
protected java.net.InetSocketAddress local
-
remote
protected java.net.InetSocketAddress remote
-
sock
protected java.net.Socket sock
-
output
protected java.io.DataOutputStream output
-
output_lock
protected final java.util.concurrent.locks.Lock output_lock
-
srv_sock
protected java.net.ServerSocket srv_sock
-
acceptor
protected UnicastTestTcpSlow.Acceptor acceptor
-
start
protected long start
-
stop
protected long stop
-
total_time
protected long total_time
-
msgs_per_sec
protected long msgs_per_sec
-
print
protected long print
-
current_value
protected java.util.concurrent.atomic.AtomicLong current_value
-
total_bytes
protected java.util.concurrent.atomic.AtomicLong total_bytes
-
TCP_NODELAY
protected static final boolean TCP_NODELAY
- See Also:
- Constant Field Values
-
SOCK_SEND_BUF_SIZE
protected static final int SOCK_SEND_BUF_SIZE
- See Also:
- Constant Field Values
-
SOCK_RECV_BUF_SIZE
protected static final int SOCK_RECV_BUF_SIZE
- See Also:
- Constant Field Values
-
START
protected static final byte START
- See Also:
- Constant Field Values
-
DATA
protected static final byte DATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(java.lang.String local_addr, java.lang.String remote_addr, int local_port, int remote_port) throws java.lang.Exception- Throws:
java.lang.Exception
-
eventLoop
public void eventLoop() throws java.lang.Exception- Throws:
java.lang.Exception
-
sendMessages
void sendMessages() throws java.lang.Exception- Throws:
java.lang.Exception
-
setSenderThreads
void setSenderThreads() throws java.lang.Exception- Throws:
java.lang.Exception
-
setNumMessages
void setNumMessages() throws java.lang.Exception- Throws:
java.lang.Exception
-
setMessageSize
void setMessageSize() throws java.lang.Exception- Throws:
java.lang.Exception
-
main
public static void main(java.lang.String[] args)
-
help
static void help()
-
receive
public void receive(Message msg)
-
readMessage
protected static Message readMessage(byte[] buf, int offset, int length) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-