예제 #1
0
파일: KSPIRC.cs 프로젝트: timmersuk/ksp_irc
 private void logSendCommand(IRCCommand cmd)
 {
     if (config.debug)
     {
         chatWindow.addToChannel(DEBUG_CHANNEL_HANDLE, "CLIENT", cmd.ToString());
     }
 }
예제 #2
0
 public void send(IRCCommand cmd)
 {
     if (onCommandSent != null)
     {
         onCommandSent(new IRCCommandEvent(cmd));
     }
     byte[] data = Encoding.UTF8.GetBytes(cmd.ToString() + "\r\n");
     try
     {
         stream.Write(data, 0, data.Length);
     }
     catch (SocketException ex)
     {
         handleException(ex, true);
     }
     catch (IOException ex)
     {
         handleException(ex, true);
     }
 }