by "avakharia_ibsdev@[EMAIL PROTECTED]
" <avakharia_ibsdev@[EMAIL PROTECTED]
>
Jun 10, 2008 at 10:34 AM
Hi All,
I have sent one post in this group long before. Issue was my
application was not able to bind on ****t.
Senerio was one client was connected successfully and then I close the
application and If I switch the user and try to bind the the ****t on
application launch, bind function was always failed.
Finally, I have solve the issue. Do not have much reason why the issue
was. But it is resolved. I am posting in the group because if someone
is having the same issue can try with this.
1. My server was listening for local client. I had used INADDR_ANY in
sockaddr structure. Now I have used INADDR_LOOPBACK.
2. Server is waiting for one client only. On accepting that client
there is one thread started for send/recv data. Thread is in while
loop using one boolean variable. While making this boolean FALSE,
thread is going to terminate. On terminating the thread i have close
the accepted socket using SHUTDOWN() and then CLOSE().
StopListening() function is making boolean FALSE and also closing
listening Socket with the same APIs SHUTDOWN() and CLOSE(). This way
my Listening socket gets close first and accepted socket was closed
then. I have removed the code of closing listening socket in
StopListening function and moved after closing accepted socket in
thread function.
Actually there is no logic. But with these two changes it is working
perfect. If someone Know the reason for it and specific to MAC. Please
let me know.
Thanks.
Archita