Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public int ReadSocket()
        {
            int count = 0;

            int available = Socket.Available;

            if (available > 0)
            {
                if (available > 0x4000)
                {
                    available = 0x4000;
                }
                count = Socket.Receive(this.byteBuff, available, SocketFlags.None);
                if (count > 0)
                {
                    sockBuff = sockBuff + Telegrams.GetString(this.byteBuff, 0, count);
                }
            }
            return(count);
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sockData"></param>
 /// <returns></returns>
 public bool WriteSocket(string sockData)
 {
     byte[] bytes = Telegrams.GetBytes(sockData);
     Socket.Send(bytes);
     return(true);
 }