public void AddSendEntry(string text,long size) { m_pEntries.Add(new SocketLogEntry(text,size,SocketLogEntryType.SendToRemoteEP)); s += CreateEntry(text,"<<<"); }
/// <summary> /// Sends line to socket. /// </summary> /// <param name="line"></param> public void SendLine(string line) { if (!line.EndsWith("\r\n")) { line += "\r\n"; } byte[] data = m_pEncoding.GetBytes(line); int countSended = m_pSocket.Send(data); if (countSended != data.Length) { throw new Exception("Send error, didn't send all bytes !"); // ToDo: if this happens just try to resend unsent bytes } // Logging stuff if (m_pLogger != null) { m_pLogger.AddSendEntry(line); } OnActivity(); }