Exemple #1
0
        public void ProcessPacket(IPEndPoint source, AcnRootLayer header, AcnBinaryReader data)
        {
            StreamingAcnDmxPacket newPacket = AcnPacket.ReadPacket(header, data) as StreamingAcnDmxPacket;

            if (newPacket != null)
            {
                RaiseNewPacket(source, newPacket);
            }
        }
Exemple #2
0
        public void SendPacket(AcnPacket packet)
        {
            //Set the senders CID.
            packet.Root.SenderId = SenderId;

            MemoryStream    data   = new MemoryStream();
            AcnBinaryWriter writer = new AcnBinaryWriter(data);

            AcnPacket.WriteTcpPacket(packet, writer);
            socket.Send(data.GetBuffer(), 0, (int)data.Length, SocketFlags.None);
        }
Exemple #3
0
        public void SendPacket(AcnPacket packet, IPEndPoint destination)
        {
            //Set the senders CID.
            packet.Root.SenderId = SenderId;

            MemoryStream    data   = new MemoryStream();
            AcnBinaryWriter writer = new AcnBinaryWriter(data);

            AcnPacket.WritePacket(packet, writer);

            BeginSendTo(data.GetBuffer(), 0, (int)data.Length, SocketFlags.None, destination, null, null);
        }
Exemple #4
0
        /// <summary>
        /// Processes the packet that have been recieved and allocated to this filter.
        /// </summary>
        /// <param name="source">The source IP address of the packet.</param>
        /// <param name="header">The header information for the ACN packet.</param>
        /// <param name="data">The data reader for the remaining packet data.</param>
        /// <remarks>
        /// Only packets that have supported protocol ID's will be sent to this function.
        /// </remarks>
        void IProtocolFilter.ProcessPacket(IPEndPoint source, AcnRootLayer header, AcnBinaryReader data)
        {
            RdmNetPacket newPacket = AcnPacket.ReadPacket(header, data) as RdmNetPacket;

            if (newPacket != null)
            {
                RdmBinaryReader dmxReader = new RdmBinaryReader(new MemoryStream(newPacket.RdmNet.RdmData));

                //Skip Start Code and sub-start code
                dmxReader.BaseStream.Seek(1, SeekOrigin.Begin);

                RdmPacket rdmPacket = RdmPacket.ReadPacket(dmxReader);
                RaiseNewRdmPacket(new RdmEndPoint(source, newPacket.Framing.EndpointID), rdmPacket);
            }
        }
Exemple #5
0
        /// <summary>
        /// Processes the packet that have been recieved and allocated to this filter.
        /// </summary>
        /// <param name="source">The source IP address of the packet.</param>
        /// <param name="header">The header information for the ACN packet.</param>
        /// <param name="data">The data reader for the remaining packet data.</param>
        /// <remarks>
        /// Only packets that have supported protocol ID's will be sent to this function.
        /// </remarks>
        public void ProcessPacket(IPEndPoint source, AcnRootLayer header, AcnBinaryReader data)
        {
            AcnPacket packet = AcnPacket.ReadPacket(header, data);

            if (packet is StreamingAcnDmxPacket)
            {
                RaiseNewPacket(source, (StreamingAcnDmxPacket)packet);
            }
            if (packet is StreamingAcnSynchronizationPacket)
            {
                RaiseNewSynchronize(source, (StreamingAcnSynchronizationPacket)packet);
            }
            if (packet is StreamingAcnDiscoveryPacket)
            {
                RaiseNewDiscovery(source, (StreamingAcnDiscoveryPacket)packet);
            }
        }
Exemple #6
0
 public void SendPacket(AcnPacket packet, IPAddress destination)
 {
     SendPacket(packet, new IPEndPoint(destination, Port));
 }