Class ConnectionException
Thrown whenever connection with cache server is lost while performing an operation on an outproc cache.
Inherited Members
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public class ConnectionException : OperationFailedException
Examples
The following example demonstrates how to use this exception in your code.
try
{
Cache cache = NCache.InitializeCache("sampleCache");
cache.Add("TestKey","sampleData");
}
catch(ConnectionException ex)
{
}
Constructors
ConnectionException()
default constructor.
Declaration
public ConnectionException()
ConnectionException(SerializationInfo, StreamingContext)
overloaded constructor, manual serialization.
Declaration
protected ConnectionException(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |
ConnectionException(System.Net.IPAddress, Int32)
overloaded constructor, takes the ipAddress and port as parameter.
Declaration
public ConnectionException(System.Net.IPAddress ipAddress, int port)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPAddress | ipAddress | |
System.Int32 | port |
ConnectionException(String)
overloaded constructor, takes the reason as parameter.
Declaration
public ConnectionException(string reason)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason |
ConnectionException(String, System.Net.IPAddress, Int32)
overloaded constructor, takes the reason, ipAddress and port as parameter.
Declaration
public ConnectionException(string reason, System.Net.IPAddress ipAddress, int port)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | |
System.Net.IPAddress | ipAddress | |
System.Int32 | port |
Properties
IPAddress
IPAddress of broken connection
Declaration
public System.Net.IPAddress IPAddress { get; }
Property Value
Type | Description |
---|---|
System.Net.IPAddress |
Port
Port of broken connection
Declaration
public int Port { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
GetObjectData(SerializationInfo, StreamingContext)
manual serialization
Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | |
StreamingContext | context |