本文整理汇总了C#中System.Net.Sockets.SocketException.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SocketException.ToString方法的具体用法?C# SocketException.ToString怎么用?C# SocketException.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Net.Sockets.SocketException
的用法示例。
在下文中一共展示了SocketException.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: m_LoginClient_OnNetworkError
/// <summary>
/// Event triggered if a network error occurs while communicating with
/// the LoginServer.
/// </summary>
/// <param name="Exception"></param>
private void m_LoginClient_OnNetworkError(SocketException Exc)
{
MessageBox.Show(Exc.ToString());
Application.Exit();
}
示例2: SplashPresenter_StartApplication_Picks_Up_SocketExceptions_When_Starting_WebServer
public void SplashPresenter_StartApplication_Picks_Up_SocketExceptions_When_Starting_WebServer()
{
var exception = new SocketException();
_WebServer.SetupSet(s => s.Online = true).Callback(() => {
throw exception;
});
_WebServer.Setup(a => a.Port).Returns(123);
_Presenter.Initialise(_View.Object);
_Presenter.StartApplication();
_Log.Verify(g => g.WriteLine("Caught exception when starting web server: {0}", exception.ToString()), Times.Once());
_View.Verify(v => v.ReportProblem(String.Format(Strings.CannotStartWebServerFull, 123), Strings.CannotStartWebServerTitle, false), Times.Once());
_View.Verify(v => v.ReportProblem(Strings.SuggestUseDifferentPortFull, Strings.SuggestUseDifferentPortTitle, false), Times.Once());
}
示例3: m_LoginClient_OnNetworkError
/// <summary>
/// Event triggered if a network error occurs while communicating with
/// the LoginServer.
/// </summary>
/// <param name="Exception"></param>
private static void m_LoginClient_OnNetworkError(SocketException Exc)
{
Console.WriteLine(Exc.ToString());
Console.ReadLine();
Environment.Exit(0);
}