Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix.bind #3045

Closed
vicuna opened this issue Nov 21, 2001 · 2 comments
Closed

Unix.bind #3045

vicuna opened this issue Nov 21, 2001 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Nov 21, 2001

Original bug ID: 647
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: John W. Small
Version: 3.02
OS: W2K
Submission from: ppp-65-91-142-145.mclass.broadwing.net (65.91.142.145)

I'm trying to rebind to a unix socket. But
shutdown doesn't unbind a previously bound socket:

Unix.bind socket sock_addr;
Unix.listen socket maxConnections;
...
Unix.shutdown socket Unix.SHUTDOWN_ALL;

...

Unix.bind another_socket sock_addr; (* raises bind exception *)

@vicuna
Copy link
Author

vicuna commented Nov 23, 2001

Comment author: administrator

I'm trying to rebind to a unix socket. But
shutdown doesn't unbind a previously bound socket:
Unix.bind socket sock_addr;
Unix.listen socket maxConnections;
...
Unix.shutdown socket Unix.SHUTDOWN_ALL;
...
Unix.bind another_socket sock_addr; (* raises bind exception *)

I believe you need to close the first socket with Unix.close. Also,
depending on whether the SO_REUSEADDR option is set or not, you may
have to wait a few seconds before being able to re-bind on the same
address.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Nov 23, 2001

Comment author: administrator

Answer: use Unix.close and SO_REUSEADDR.

@vicuna vicuna closed this as completed Nov 23, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant