Mercurial > hg > Members > kono > WifiBroadcast
changeset 10:fc180f38257e
multiple sender
author | one |
---|---|
date | Sun, 29 Jul 2012 11:10:08 +0900 |
parents | 95d58cc5bb0b |
children | 7912fd3af027 |
files | src/wifibroadcast/WifiBroadcast.java src/wifibroadcast/WifiBroadcastTest.java |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/wifibroadcast/WifiBroadcast.java Sun Jul 29 00:03:29 2012 +0900 +++ b/src/wifibroadcast/WifiBroadcast.java Sun Jul 29 11:10:08 2012 +0900 @@ -74,6 +74,7 @@ if (broadcast == null) continue; // Use the address + System.out.println("MTU="+networkInterface.getMTU()); return broadcast; } }
--- a/src/wifibroadcast/WifiBroadcastTest.java Sun Jul 29 00:03:29 2012 +0900 +++ b/src/wifibroadcast/WifiBroadcastTest.java Sun Jul 29 11:10:08 2012 +0900 @@ -28,15 +28,15 @@ try { if (multicast) { for(int i=0;i<wbr.length;i++) wbr[i] = new WifiMulticast(i,MCASTADDR,port,WifiReceiver.SocketType.Receiver); - Thread.sleep(timeout); + Thread.sleep(timeout/4); for(int i=0;i<wbs.length;i++) wbs[i] = new WifiMulticast(i,MCASTADDR,port,WifiReceiver.SocketType.Sender); } else if (mchannel) { - for(int i=0;i<wbr.length;i++) wbr[i]= new WifiMulticastChannel(i,MCASTADDR,port,WifiReceiver.SocketType.Receiver); - Thread.sleep(timeout); + for(int i=0;i<wbr.length;i++) wbr[i] = new WifiMulticastChannel(i,MCASTADDR,port,WifiReceiver.SocketType.Receiver); + Thread.sleep(timeout/4); for(int i=0;i<wbs.length;i++) wbs[i] = new WifiMulticastChannel(i,MCASTADDR,port,WifiReceiver.SocketType.Sender); } else { - for(int i=0;i<wbr.length;i++) wbr[i]= new WifiBroadcast(i,port,WifiReceiver.SocketType.Receiver); - Thread.sleep(timeout); + for(int i=0;i<wbr.length;i++) wbr[i] = new WifiBroadcast(i,port,WifiReceiver.SocketType.Receiver); + Thread.sleep(timeout/4); for(int i=0;i<wbs.length;i++) wbs[i] = new WifiBroadcast(i,port,WifiReceiver.SocketType.Sender); } } catch (IOException e) { @@ -56,6 +56,7 @@ else if (args[i].equals("-s")) { i++; sender_count = getOptInt(args, count, i); wbs = new WifiReceiver[sender_count]; } else if (args[i].equals("-c")) { i++; count = getOptInt(args, count, i);} else if (args[i].equals("-t")) { i++; timeout = getOptInt(args, count, i);} + else if (args[i].equals("-T")) { i++; testSize = getOptInt(args, count, i);} else if (args[i].equals("-p")) { i++; port = getOptInt(args, count, i);} } }