Skip to content

Commit 6e80838

Browse files
author
David R. MacIver
committed
allow independent setting of send and receive buffer sizes in MulticastMain
1 parent 74a6967 commit 6e80838

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/src/com/rabbitmq/examples/MulticastMain.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public static void main(String[] args) {
8585
int minMsgSize = intArg(cmd, 's', 0);
8686
int maxRedirects = intArg(cmd, 'd', 0);
8787
int timeLimit = intArg(cmd, 'z', 0);
88-
final int bufferSize = intArg(cmd, 'b', -1);
88+
final int sendBufferSize = intArg(cmd, 'b', -1);
89+
final int receiveBufferSize = intArg(cmd, 'c', -1);
8990
List flags = lstArg(cmd, 'f');
9091

9192
//setup
@@ -102,10 +103,11 @@ public static void main(String[] args) {
102103
Connection conn = new ConnectionFactory(params){
103104
@Override public void configureSocket(Socket socket) throws IOException{
104105
super.configureSocket(socket);
105-
if(bufferSize > 0){
106-
socket.setReceiveBufferSize(bufferSize);
107-
socket.setSendBufferSize(bufferSize);
108-
}
106+
if(receiveBufferSize > 0)
107+
socket.setReceiveBufferSize(receiveBufferSize);
108+
if(sendBufferSize > 0 )
109+
socket.setSendBufferSize(sendBufferSize);
110+
109111
}
110112
}.newConnection(addresses, maxRedirects);
111113
consumerConnections[i] = conn;

0 commit comments

Comments
 (0)