message += "port: " + "5956\n"; // port number
message += "device_address_long: " + DEVIDE_MAC_ADDRESS + "\n";
DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("192.168.2.227"), 5005); // address and port of the gateway which means Raspberry PI's IP address
- DatagramSocket socket = new DatagramSocket(11222);
+ //DatagramSocket socket = new DatagramSocket(11222);
+ DatagramSocket socket = new DatagramSocket(12345);
socket.setSendBufferSize(4096);
socket.setReceiveBufferSize(4096);
socket.send(sendPacket);
+ socket.setReuseAddress(true);
+ socket.close();
IoTDeviceAddress zigUdpAddr = new IoTDeviceAddress("192.168.2.227", 5956, 5005,false,false);
IoTZigbeeAddress zigAddrLong = new IoTZigbeeAddress(DEVIDE_MAC_ADDRESS);
message += "port: " + "5957\n"; // port number
message += "device_address_long: " + DEVIDE_MAC_ADDRESS + "\n";
DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("192.168.2.227"), 5005);
- DatagramSocket socket = new DatagramSocket(11111);
+ //DatagramSocket socket = new DatagramSocket(11111);
+ DatagramSocket socket = new DatagramSocket(12345);
socket.setSendBufferSize(4096);
socket.setReceiveBufferSize(4096);
socket.send(sendPacket);
+ socket.setReuseAddress(true);
+ socket.close();
IoTDeviceAddress zigUdpAddr = new IoTDeviceAddress("192.168.2.227", 5957, 5005,false,false);
IoTZigbeeAddress zigAddrLong = new IoTZigbeeAddress(DEVIDE_MAC_ADDRESS);
message += "port: " + PORT_NUMBER + "\n"; // port number
message += "device_address_long: " + DEVIDE_MAC_ADDRESS + "\n";
DatagramPacket sendPacket = new DatagramPacket(message.getBytes(), message.getBytes().length, InetAddress.getByName("192.168.2.227"), 5005); // address and port of the gateway which means Raspberry PI's IP address
- DatagramSocket socket = new DatagramSocket(22222);
+ //DatagramSocket socket = new DatagramSocket(22222);
+ DatagramSocket socket = new DatagramSocket(12345);
socket.setSendBufferSize(4096);
socket.setReceiveBufferSize(4096);
socket.send(sendPacket);
+ socket.setReuseAddress(true);
+ socket.close();
IoTDeviceAddress zigUdpAddr = new IoTDeviceAddress("192.168.2.227", PORT_NUMBER, 5005,false,false);
IoTZigbeeAddress zigAddrLong = new IoTZigbeeAddress(DEVIDE_MAC_ADDRESS);
$(JAVAC) -classpath .:$(RUNTIMEJARS):$(PHONEJARS):$(ZIPJARS) iotruntime/*.java iotruntime/master/*.java iotruntime/slave/*.java iotruntime/messages/*.java iotruntime/stub/*.java iotruntime/zigbee/*.java -d $(BIN_DIR)
cp ../localconfig/iotruntime/IoTMaster.config $(BIN_DIR)/iotruntime/
cp ../localconfig/iotruntime/IoTSlave.config $(BIN_DIR)/iotruntime/
- cp ../sslkey/*.jks $(BIN_DIR)/iotruntime/
+ cp ../others/sslkey/*.jks $(BIN_DIR)/iotruntime/
cp -r ../localconfig/mysql $(BIN_DIR)/iotruntime/
PHONY += doc
*
* @return void
*/
- public void closeConnection() {
+ public void closeConnection() throws IOException {
+ socket.setReuseAddress(true);
socket.close();
}
}