public WritableRemoteManager(IInjector injector) { using (LOGGER.LogFunction("WritableRemoteManager::WritableRemoteManager")) { _observerContainer = new WritableObserverContainer <T>(); _cachedClients = new Dictionary <IPEndPoint, ProxyObserver>(); _injector = injector; LocalEndpoint = new IPEndPoint(NetworkUtils.LocalIPAddress, 0); Identifier = new SocketRemoteIdentifier(LocalEndpoint); } }
public WritableRemoteManager(IPAddress localAddress, int port, ITcpPortProvider tcpPortProvider, IInjector injector) { if (localAddress == null) { throw new ArgumentNullException("localAddress"); } if (port < 0) { throw new ArgumentException("Listening port must be greater than or equal to zero"); } _observerContainer = new WritableObserverContainer <T>(); _cachedClients = new Dictionary <IPEndPoint, ProxyObserver>(); _injector = injector; IPEndPoint localEndpoint = new IPEndPoint(localAddress, port); // Begin to listen for incoming messages _server = new WritableTransportServer <IWritableRemoteEvent <T> >(localEndpoint, _observerContainer, tcpPortProvider, injector); _server.Run(); LocalEndpoint = _server.LocalEndpoint; Identifier = new SocketRemoteIdentifier(LocalEndpoint); }