예제 #1
0
 /// <summary>
 /// Sets up a socket and the necessary handlers.
 /// </summary>
 public void Init()
 {
     socket = new ClientSocket();    // create a socket
     socket.ConnectSuccess += new EventHandler(SocketConnectedHandler);
     socket.Closed += new EventHandler(SocketClosedHandler);
     socket.ConnectionException += new ClientSocket.ExceptionEventHandler(SocketErrorHandler);
     socket.SendException += new ClientSocket.ExceptionEventHandler(SocketErrorHandler);
     socket.GeneralException += new ClientSocket.ExceptionEventHandler(SocketErrorHandler);
     socket.DataArrival += new EventHandler(DataArrivalHandler);
 }
예제 #2
0
 /// <summary>
 /// Triggered when a socket exception is raised.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SocketErrorHandler(object sender, ClientSocket.ExceptionEventArgs e)
 {
     Debug.WriteLine(e.CatchedException.Message, "SocketError.");
     if (ConnectionSocketError != null)
         ConnectionSocketError(sender, e);
     else
         throw (e.CatchedException);
     Init();
 }
예제 #3
0
파일: fIRC.cs 프로젝트: lpradel/lpIRC
 private void ConnectionError(object sender, ClientSocket.ExceptionEventArgs e)
 {
     Log(e.CatchedException.Message, Color.Red);
 }