/// <summary> /// Creates a new reverse listener host for a client. /// </summary> public void CreateListener( Uri url, ConnectionWaitingHandlerAsync OnConnectionWaiting, EventHandler <ConnectionStatusEventArgs> OnConnectionStatusChanged ) { if (url == null) { throw new ArgumentNullException(nameof(url)); } var listener = TransportBindings.Listeners.GetListener(url.Scheme); if (listener == null) { throw ServiceResultException.Create( StatusCodes.BadProtocolVersionUnsupported, "Unsupported transport profile for scheme {0}.", url.Scheme); } m_listener = listener; Url = url; m_onConnectionWaiting = OnConnectionWaiting; m_onConnectionStatusChanged = OnConnectionStatusChanged; }
/// <summary> /// Creates a new reverse listener host for a client. /// </summary> public void CreateListener( Uri url, ConnectionWaitingHandlerAsync OnConnectionWaiting, EventHandler <ConnectionStatusEventArgs> OnConnectionStatusChanged ) { if (url == null) { throw new ArgumentNullException(nameof(url)); } var listener = TransportListenerBindings.GetTransportListener(url.Scheme); if (listener == null) { throw new ArgumentException(nameof(url), "No suitable listener found."); } m_listener = listener; Url = url; m_onConnectionWaiting = OnConnectionWaiting; m_onConnectionStatusChanged = OnConnectionStatusChanged; }