コード例 #1
0
        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());
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Blayer98/Project-Dollhouse
 /// <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();
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: ddfczm/Project-Dollhouse
 /// <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);
 }
コード例 #4
0
 private void server_ErrorReceived(object sender, NetSockErrorReceivedEventArgs e)
 {
     if (e.Exception.GetType() == typeof(System.Net.Sockets.SocketException))
     {
         System.Net.Sockets.SocketException s = (System.Net.Sockets.SocketException)e.Exception;
         account.Log(new ErrorTextInformation("Error: " + e.Function + " - " + s.SocketErrorCode.ToString() + "\r\n" + s.ToString()), 0);
     }
     else
     {
         account.Log(new ErrorTextInformation("Error: " + e.Function + "\r\n" + e.Exception.ToString()), 0);
     }
 }
コード例 #5
0
ファイル: NetSocket.cs プロジェクト: kimhwi9202/crown_temp
 private void OnSocketError(object sender, EventNetSockErrorReceived e)
 {
     if (e.Exception.GetType() == typeof(System.Net.Sockets.SocketException))
     {
         System.Net.Sockets.SocketException s = (System.Net.Sockets.SocketException)e.Exception;
         Debug.Log("OnSocketError > System.Net.Sockets Exception " + e.Function + " - " + s.SocketErrorCode.ToString() + " => " + s.ToString());
     }
     else
     {
         Debug.Log("OnSocketError > ERROR : " + e.Function.ToString() + " => " + e.Exception.ToString());
     }
     _ReceiveSchedule.AddMessage(eEventIDs.SocketError);
 }