Hi,
I wanted to know how can we close or shutdown the socket. I have built a chat program using asynchronous sockets and now I want to change the port at run time. But, when I try to close the port it is already listening to I get exceptions like only "only one usage of each socket address protocol network address port is normally permitted sockets" or "the iasyncresult object was not returned from the corresponding asynchronous method on this class." I am new to this stuff and don't know how to fix it. I read lot of stuff but nothing helped. can anyone suggest what to do?
I am trying to close the previous port it was listening on and start listening on new port. I also tried shutdown socket before closing it. I am very confused. Please help..
Thanks!