Exemple #1
0
        public static Udp ReceiveStart(this Udp udp,
                                       Action <Udp, IDatagramReadCompletion> receiveAction)
        {
            Contract.Requires(udp != null);
            Contract.Requires(receiveAction != null);

            udp.OnReceive(receiveAction);
            udp.ReceiveStart();

            return(udp);
        }
Exemple #2
0
        public static Udp ReceiveStart(this Udp udp,
                                       IPEndPoint localEndPoint,
                                       Action <Udp, IDatagramReadCompletion> receiveAction,
                                       bool dualStack = false)
        {
            Contract.Requires(udp != null);
            Contract.Requires(localEndPoint != null);
            Contract.Requires(receiveAction != null);

            udp.Bind(localEndPoint, dualStack);
            udp.OnReceive(receiveAction);
            udp.ReceiveStart();

            return(udp);
        }