@exosceleton--My guess would be that Matlab's java machine is not doing garbage collecting properly (I've seen similar problems with Matlab's implementation of database cursor objects). So when you go through 256 IP addresses, you're creating 256 Java Socket objects, and they're clogging up Matlab's allocated Java space and slowing down your computer. As a workaround, why not send a single packet out to your network's broadcast address (see http://en.wikipedia.org/wiki/Broadcast_address)? You should be able to use 255.255.255.255 in your call to jupd.m. All the machines on your network will receive the UDP packet, but only the machine you're looking for will know how to respond to the specific UDP packet you send. Once this "handshake" is complete, the two computers will know each other's IP addresses, and you will no longer need to use the broadcast address.