Ejemplo n.º 1
0
        /// <summary>
        /// Similar to the send method in the client.
        /// Fills out the size field and adds the data to a memory stream.
        /// </summary>
        /// <param name="citpMessage">The citp message.</param>
        /// <returns>The read packet.</returns>
        private static CitpRecieveData WriteToMemoryStream(CitpHeader citpMessage)
        {
            CitpRecieveData  data   = new CitpRecieveData();
            CitpBinaryWriter writer = new CitpBinaryWriter(data);

            citpMessage.WriteData(writer);
            citpMessage.WriteMessageSize(writer);

            return(data);
        }
Ejemplo n.º 2
0
        public void BeginSend(CitpHeader citpMessage)
        {
            MemoryStream     data   = new MemoryStream();
            CitpBinaryWriter writer = new CitpBinaryWriter(data);

            citpMessage.WriteData(writer);
            citpMessage.WriteMessageSize(writer);

            BeginSendTo(data.GetBuffer(), 0, (int)data.Length, SocketFlags.None, new IPEndPoint(MulticastGroup, Port), null, null);
        }