Creates a new connection to a Gateway daemon.
Namespace:
IBM.CTGAssembly: IBM.CTG.Client (in IBM.CTG.Client.dll) Version: 1.0.0.0
Syntax
C# |
---|
public GatewayConnection( string hostName, int port ) |
Visual Basic (Declaration) |
---|
Public Sub New ( _ hostName As String, _ port As Integer _ ) |
Visual C++ |
---|
public: GatewayConnection( String^ hostName, int port ) |
Parameters
- hostName
- Type: System..::.String
The host name of the Gateway daemon to connect to.
- port
- Type: System..::.Int32
The port that the Gateway daemon is accepting TCP/IP requests on.
Remarks
To specify a connection timeout, use GatewayConnection(String, Int32, Int32).
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | hostName is nullNothingnullptra null reference (Nothing in Visual Basic). |
System..::.ArgumentOutOfRangeException | The port number is not valid. |
System..::.InvalidOperationException | The version of ctgclient.dll installed on the system is not compatible with this version of IBM.CTG.Client.dll. |
System.Net.Sockets..::.SocketException |
The host name did not resolve to a valid IP address. -or- Failed to establish a connection with the Gateway daemon. -or- The connection to the Gateway daemon has been lost. |
IBM.CTG..::.GatewayException | An error occurred within the Gateway daemon. |