Esempio n. 1
0
        /// <summary>
        /// Sends line to Socket.
        /// </summary>
        /// <param name="socket"></param>
        /// <param name="lineData"></param>
        public static void SendLine(BufferedSocket socket, string lineData)
        {
            byte[] byte_data   = System.Text.Encoding.Default.GetBytes(lineData + "\r\n");
            int    countSended = socket.Send(byte_data);

            if (countSended != byte_data.Length)
            {
                throw new Exception("Send error, didn't send all bytes !");
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Sends line to Socket.
 /// </summary>
 /// <param name="socket"></param>
 /// <param name="lineData"></param>
 public static void SendLine(BufferedSocket socket,string lineData)
 {
     byte[] byte_data = System.Text.Encoding.Default.GetBytes(lineData + "\r\n");
     int countSended = socket.Send(byte_data);
     if(countSended != byte_data.Length){
         throw new Exception("Send error, didn't send all bytes !");
     }
 }