示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EpicsUDPConnection"/> class.
        /// </summary>
        /// <param name="ipe">
        /// The ipe.
        /// </param>
        internal EpicsUDPConnection(IPEndPoint ipe)
        {
            this.UDPSocket = UDPSocketManager.GetSocket(ipe);

            /*UDPSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
             * UDPSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
             * UDPSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
             * UDPSocket.Bind(ipe);*/
            this.Start();
        }
示例#2
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "EpicsUDPConnection" /> class.
        ///   Client Constructor, will try to get his Port automaticly
        /// </summary>
        internal EpicsUDPConnection()
        {
            this.UDPSocket = UDPSocketManager.GetSocket();

            /*UDPSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
             * UDPSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
             * UDPSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
             *
             * //do a stupid send so that it get's himself an endpoint
             * UDPSocket.SendTo(new byte[1]{0}, new IPEndPoint(IPAddress.Parse("127.0.0.1"), 60000));*/
            this.Start();
        }