private void logSendCommand(IRCCommand cmd) { if (config.debug) { chatWindow.addToChannel(DEBUG_CHANNEL_HANDLE, "CLIENT", cmd.ToString()); } }
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); } }