Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] closing sockets
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mike Furr <mike.furr@u...>
Subject: [Caml-list] closing sockets
Hi all,

I've been playing around with developing a network app in ocaml and came
across an annoying 'misunderstaning' of the documentation.  Namely,
'shutdown_connection' does not clean up after 'open_connection'.  While
the socket is shutdown, the file descriptor is not closed and thus must
be done so explicitly, else you can quickly run out of file
descriptors... :(

It seems that it would be more intuitive(as a high level networking
function) if shutdown_con also closed the socket, effectively undoing
the allocations of open_con.  In fact, the networking example in this
book[1] does not do this, which is how I erred in the first place. 

I'm not networking/socket expert, so, is there any reason for this not
to occur?  The only problem I see is that making the change would break
any program that correctly closes the socket on its own...

thanks,

[1] Developing Applications With Objective Caml[english translation]
-- 
Mike Furr <mike.furr@umbc.edu>