Beispiel #1
0
        private void Open(UdpTestType testType, EndPoint bindEndPoint, EndPoint connectEndPoint)
        {
            switch (testType)
            {
            case UdpTestType.BROADCAST:
            {
                serviceHandler = new UdpBroadcast_ServiceHandler(this.reactor, bindEndPoint, connectEndPoint);
                break;
            }

            case UdpTestType.MULTICAST:
            {
                serviceHandler = new UdpMulticast_ServiceHandler(this.reactor, bindEndPoint, connectEndPoint, false, 4);
                break;
            }

            case UdpTestType.P2P:
            {
                serviceHandler = new UdpP2P_ServiceHandler(this.reactor, bindEndPoint, connectEndPoint);
                break;
            }

            default:
                break;
            }

            SetupEventHandlerNotifications(serviceHandler);
            serviceHandler.Open();
        }
 private void ActivateServiceHandler(IServiceHandler serviceHandler)
 {
     if (serviceHandler.Handle.UserSocket.Connected)
     {
         log.Info("ServiceHandler connected.");
         serviceHandler.Open();
         AcceptNotification?.Invoke();
     }
     else
     {
         log.Warn("ServiceHandler not connected.");
         serviceHandler.Dispose();
         serviceHandler = null;
     }
 }
 protected virtual void ActivateServiceHandler(IServiceHandler serviceHandler)
 {
     serviceHandler.Open();
 }