Actually i read a configuration file for the IP address. I have tried running the same code inside a private LAN (all machines having private IPs) where it worked fine. But when i try it using public IPs it shows this error.
Is that scenario causing this error, or is it faulting in reading the config file.