本文整理汇总了C#中Target.HandleSocketError方法的典型用法代码示例。如果您正苦于以下问题:C# Target.HandleSocketError方法的具体用法?C# Target.HandleSocketError怎么用?C# Target.HandleSocketError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Target
的用法示例。
在下文中一共展示了Target.HandleSocketError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestHandleSocketError_SocketAsyncEventArgsIsNull_Fail
public void TestHandleSocketError_SocketAsyncEventArgsIsNull_Fail()
{
using ( var server = new RpcServer() )
using ( var target = new Target( server ) )
using ( var socket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ) )
{
target.HandleSocketError( socket, null );
}
}
示例2: TestHandleSocketError_FatalError_False
public void TestHandleSocketError_FatalError_False()
{
using ( var server = new RpcServer() )
using ( var target = new Target( server ) )
using ( var socket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ) )
using ( var e = new SocketAsyncEventArgs() )
{
e.SocketError = SocketError.AccessDenied;
var result = target.HandleSocketError( socket, e );
Assert.That( result, Is.False );
}
}
示例3: TestHandleSocketError_SocketIsNull_Fail
public void TestHandleSocketError_SocketIsNull_Fail()
{
using ( var server = new RpcServer() )
using ( var target = new Target( server ) )
using ( var e = new SocketAsyncEventArgs() )
{
target.HandleSocketError( null, e );
}
}
示例4: TestHandleSocketError_IgnoreableError_True
public void TestHandleSocketError_IgnoreableError_True()
{
using ( var server = new RpcServer() )
using ( var target = new Target( server ) )
using ( var socket = new Socket( AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp ) )
using ( var e = new SocketAsyncEventArgs() )
{
e.SocketError = SocketError.Shutdown;
var result = target.HandleSocketError( socket, e );
Assert.That( result, Is.True );
}
}