diff src/wifibroadcast/WifiMulticastChannel.java @ 15:cce76e5eb29b

with tcp
author one
date Tue, 31 Jul 2012 16:18:26 +0900
parents 7b43c3c60708
children 3d71ca942a48
line wrap: on
line diff
--- a/src/wifibroadcast/WifiMulticastChannel.java	Mon Jul 30 14:04:22 2012 +0900
+++ b/src/wifibroadcast/WifiMulticastChannel.java	Tue Jul 31 16:18:26 2012 +0900
@@ -19,7 +19,7 @@
 	protected SocketAddress sAddr;
 	// select on DatagramChannel does not work now
 	protected Selector selector;
-	protected boolean selectMode = false; 
+	protected boolean selectMode = true; 
 	
 	public WifiMulticastChannel() {}
 
@@ -38,7 +38,8 @@
 			throw new IOException();
 		}
 
-		dc = SelectorProvider.provider().openDatagramChannel(StandardProtocolFamily.INET);
+		// dc = SelectorProvider.provider().openDatagramChannel(StandardProtocolFamily.INET);
+		dc = DatagramChannel.open(StandardProtocolFamily.INET);
 		dc.setOption(StandardSocketOptions.SO_REUSEADDR, true);
 		dc.setOption(StandardSocketOptions.IP_MULTICAST_IF, ni);
 		mAddr = InetAddress.getByName(mCASTADDR);