This code was working perfectly with the same IP address. But if different sockets try to connect with the different IP it's not working.