in reply to Socket connection refused problem

Thanks guys!

I removed the LocalAddress => 'localhost' parameter while creating the socket and it works!

I also tried LocalAddress => 'xx.xx.xx.xx' (the actual machine IP address) and that works too!

I knew that localhost corresponds to the local loop-back address. But I thought LocalAddress was a necessary parameter for the socket constructor and it never struck me to use the machine IP directly. I did try using the machine hostname, but that didn't work either.

Thanks again guys, I trawled the web looking for a solution but couldn't find any. I can continue with my socket programs now that that this has been solved.