First question would be, using code, how would I determine which port(s)
is/are free that am able to use. I am attempting to implement part of the
CCOW standard (http://www.hl7.org.au/CCOW.htm) which requires me to open one
or more listening ports.
By default on a windows system, the ephemeral port range is 1024 - 4999.
There is a registry setting that allows the upper range to be changed. I
really do not want have to assert registry read permissions on my assembly.
Well, I do not think it is possible to do what I am looking for using the
HttpListener. As the HTTP data transfered in this case is fairly limited, I
may have to handle reading and parsing the data myself using a TcpListener.
> > I want to be able to use an ephemeral port (system assigned port) with
> > the HttpListener class but cannot figure out how to do it. [...]
[quoted text clipped - 9 lines]
>
> Pete
Rick Strahl [MVP] - 05 Apr 2007 03:58 GMT
Hi Phil,
If I remember right HTTPListener can use multiple listeners on a single port
as it passes off to http.sys which handles the actual scheduling of TCP/IP
connections.
If you really do need to find an open port there's an inelegant solution
that should work non-theless. You can try to open the port with TCP/IP and
see if it fails - if it fails it's most likely in use.
+++ Rick ---

Signature
Rick Strahl
West Wind Technologies
www.west-wind.com/weblog
> First question would be, using code, how would I determine which port(s)
> is/are free that am able to use. I am attempting to implement part of the
[quoted text clipped - 26 lines]
>>
>> Pete