tags:

views:

25

answers:

1
+1  Q: 

ADO local ports

We have an application that connects to a couple of hundred databases using ADO. Now I know that this may not be the best way of doing things (our customer base has expanded since the application was written) and we are re-writing the application to limit the number of connections. However in the meantime if I look at the ports used on the computer running this application I see that the local port being used for the connection is ranging from 2519 to 2726.

I always thought that the local ports were up in the 32,768 range, not in the lower numbers. Using the low numbers is causing a conflict with some other server applications we are running.

An example of the actual values I am seeing from out port monitor are:
Protocol: TCP
Local port: 2582
Local address: 10.1.1.103
Remote port: 1433
Remote Address: 10.1.1.108

So my questions are:

Why is the low port number being used by ADO?
Is there any way to make it start at 32,768 or to stop it from using ports that are used by other servers?
We are also seeing a lot of connections to SQL in a Time Wait status. What determines when these are released?

Many thanks, Keith

A: 

The remote port depends on the database and protocol it uses to connect. Oracle would use sql*net / Oracle client, while Access would use plain ol' SMB. From memory the local port should be random and from a limited subset of ports.

What lower level driver and what sort of database are you connecting to? Is there an option for connection pooling?

Mark Nold