static ProtoHandler() { var config = (ProtoConfigurationSection)WebConfigurationManager.GetSection("protoChannel"); if (config == null) throw new ProtoChannelException("No protoChannel configuration section has been provided"); string hostName = config.Host; int hostPort = config.Port; string hostEndPoint = WebConfigurationManager.AppSettings["protochannel.host"]; if (hostEndPoint != null) { string[] parts = hostEndPoint.Split(new[] { ':' }, 2); if (parts.Length == 2) { int port; if ( int.TryParse(parts[1], NumberStyles.None, CultureInfo.InvariantCulture, out port) && port > 0 ) { hostName = parts[0]; hostPort = port; } } } if (hostName == null || hostPort <= 0) throw new ProtoChannelException("No host and port have been provided; specify them either in the protoChannel config section or through the protochannel.host appSetting"); Proxy = new ProtoProxyHost(hostName, hostPort, Assembly.Load(config.ServiceAssembly)); }
public CallbackChannel(ProtoProxyHost host, string channelId) { Require.NotNull(host, "host"); Require.NotNull(channelId, "channelId"); _host = host; _channelId = channelId; }
public ProtoProxyClient(ProtoProxyHost host, string key, ProtoClient client) { Require.NotNull(host, "host"); Require.NotNull(key, "key"); Require.NotNull(client, "client"); _host = host; Key = key; Client = client; _lastInteraction = DateTime.Now; }