/// <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); }
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); }