Acquires a connection from the connection pool, with a specified timeout period.
Namespace:
IBM.CTGAssembly: IBM.CTG.Client (in IBM.CTG.Client.dll) Version: 1.0.0.0
Syntax
C# |
---|
public GatewayConnection GetConnection( int timeout ) |
Visual Basic |
---|
Public Function GetConnection ( _ timeout As Integer _ ) As GatewayConnection |
Visual C++ |
---|
public: GatewayConnection^ GetConnection( int timeout ) |
Parameters
- timeout
- Type: System..::..Int32
The maximum time to wait for a connection to become available, in seconds.
Remarks
If there is no connection immediately available in the pool and the number of connections in the pool is less than MaxConnections, a new connection will be established.
Exceptions
Exception | Condition |
---|---|
System..::..ObjectDisposedException | The GatewayConnectionPool has been closed. |
System.Net.Sockets..::..SocketException |
A new connection was attempted but the host name did not resolve to a valid IP address. -or- A new connection was attempted but could not be established. |
System.Security..::..SecurityException | A new connection was attempted but a caller higher in the call stack does not have permission for the requested operation. |
IBM.CTG..::..GatewayException |
A connection did not become available within the specified timeout period. -or- A new connection was attempted but an error occurred within the Gateway daemon. |