Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Mac Programmer Help > Bind on ****t f...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 3768 of 3882
Post > Topic >>

Bind on ****t fails while switch the user.

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
 




 4 Posts in Topic:
Bind on port fails while switch the user.
"avakharia_ibsdev@[E  2008-06-10 10:34:17 
Re: Bind on port fails while switch the user.
Jeffrey Dutky <jeff.du  2008-06-10 13:11:56 
Re: Bind on port fails while switch the user.
Jeffrey Dutky <jeff.du  2008-06-10 22:53:38 
Re: Bind on port fails while switch the user.
"avakharia_ibsdev@[E  2008-06-13 10:34:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 1:31:53 CST 2008.