Class ConnectionException
Thrown whenever connection with cache server is lost while performing an operation on an outproc cache.
Inheritance
System.Object
System.Exception
ConnectionException
Inherited Members
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
[Serializable]
public class ConnectionException : OperationFailedException, ISerializable, _Exception
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)
{
}
ConnectionException()
default constructor.
Declaration
public ConnectionException()
ConnectionException(IPAddress, Int32)
overloaded constructor, takes the ipAddress and port as parameter.
Declaration
public ConnectionException(IPAddress ipAddress, int port)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPAddress | ipAddress | |
System.Int32 | port |
ConnectionException(SerializationInfo, StreamingContext)
overloaded constructor, manual serialization.
Declaration
protected ConnectionException(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |
ConnectionException(String)
overloaded constructor, takes the reason as parameter.
Declaration
public ConnectionException(string reason)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason |
ConnectionException(String, IPAddress, Int32)
overloaded constructor, takes the reason, ipAddress and port as parameter.
Declaration
public ConnectionException(string reason, IPAddress ipAddress, int port)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | |
System.Net.IPAddress | ipAddress | |
System.Int32 | port |
IPAddress
IPAddress of broken connection
Declaration
public 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 |
GetObjectData(SerializationInfo, StreamingContext)
manual serialization
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | |
System.Runtime.Serialization.StreamingContext | context |