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

open_connection in ThreadUnix #2588

Closed
vicuna opened this issue Oct 16, 2000 · 1 comment
Closed

open_connection in ThreadUnix #2588

vicuna opened this issue Oct 16, 2000 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 16, 2000

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

Bug description

Full_Name: Pierre Crégut
Version: 3.00 and earlier
OS:
Submission from: machine107.cnet.fr (193.49.124.107)

If connect fails in [ThreadUnix.open_connection] then the locally created socket

is lost but not closed. This consumes descriptors.

let open_connection sockaddr =
let domain =
match sockaddr with
ADDR_UNIX _ -> PF_UNIX
| ADDR_INET (_, _) -> PF_INET
in
let sock = socket domain SOCK_STREAM 0 in
try
connect sock sockaddr; in_channel_of_descr sock, out_channel_of_descr sock

with e -> close socket; raise e (* <--- *)

A similar treatment is probably needed for [establish_server]

@vicuna
Copy link
Author

vicuna commented Nov 2, 2000

Comment author: administrator

Fixed 2000-11-02 by XL.

@vicuna vicuna closed this as completed Nov 2, 2000
@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