Guys im having some trouble with some inconsistency of running a piece of code on Windows XP and Windows 7.
Basically im trying to send a UDP packet by doing,
DatagramSocket sendSocket = new DatagramSocket();
DatagramPacket dummyPacket = new DatagramPacket(new byte[ 1 ], 1,
configuration.remoteAddress, DUMMY_PORT);
try {
sendSocket.send(dummyPacket);
log("send dummy packet succeeded so assume already connected");
} catch (NoRouteToHostException nrthe) {
log("alreadyConnected: no route to host so assume not connected");
} catch (Exception e) {
errorHandler.handleException("send dummy packet failed", e, ErrorAndWarningHandler.ERROR);
}
On Windows 7 I'm always getting success whether I connect to the remote host or not. Where as on Windows XP I'm getting an exception which is what I am expecting. Can someone tell me what I am doing wrong here for it to not work on Windows 7 ????
Appreciate it