Thursday, July 30, 2009

Need help in TCP/IP communication?

Platform: Linux


Lang: C


i hav a scenario here where i need to call bind() function in the same program on the same port number twice... for the second bind() invocation on the the same address (ip, portno) the bind results in an error... i hav closed the socket i had used in first bind before calling it the second time... where am i going wrong...? plz tell how i can bind to the same port twice in the program....

Need help in TCP/IP communication?
Is there a function you can run to verify ther status of the port Before trying to bind it again? If so, wait until the port is clear before proceeding.





I had a problem working with another lauguage that when I issued the command to close the port, was not when it closed. It closed approximately a minute later. This was probably a bug in the language I was using. But it makes me think that just because you issue a close command, you may still be trying to bind again before it has actually closed. Don't know...





Good Luck!


No comments:

Post a Comment