The reason of variable port number is I am using ARC. The instance might not be released at next time alloc and init.
Everytime I call this part code I create a new GCDAsyncUdpSocket object, then try to bind the port and then send the message. These objects are being dealloced only at a later time when I use ARC. So, actually I am trying to bind to the port several times which is not possible. Once the port is bound, I cannot bind it any more.