private static void HostSubscribeService() { subscribeServiceHost = new ServiceHost(typeof(SubscriberService)); subscribeServiceHost.AddServiceEndpoint(typeof(ISubscriber), NetTcpBindingCreator.Create(), "net.tcp://localhost:7020/SubscribeService"); subscribeServiceHost.Open(); }
private void InitializeHosts() { hosts = new List <ServiceHost>(); // service for handlling client requests ServiceHost invokerhost = new ServiceHost(typeof(Invoker)); invokerhost.Description.Name = "SCADAInvokerservice"; invokerhost.AddServiceEndpoint(typeof(ISCADAContract), NetTcpBindingCreator.Create(), new Uri("net.tcp://localhost:4000/SCADAService")); hosts.Add(invokerhost); // 2PC transaction service ServiceHost transactionServiceHost = new ServiceHost(typeof(SCADATransactionService)); transactionServiceHost.Description.Name = "SCADATransactionService"; transactionServiceHost.AddServiceEndpoint(typeof(ITransactionSCADA), NetTcpBindingCreator.Create(), new Uri("net.tcp://localhost:4001/SCADATransactionService")); transactionServiceHost.Description.Behaviors.Remove(typeof(ServiceDebugBehavior)); transactionServiceHost.Description.Behaviors.Add(new ServiceDebugBehavior() { IncludeExceptionDetailInFaults = true }); hosts.Add(transactionServiceHost); }
public MainShellViewModel() { TopMenu = new ObservableCollection <UserControl>(); TopMenu.Add(new TopMenu()); subscriber = new Subscriber(); mITMServiceProxy = new MITMServiceProxy(NetTcpBindingCreator.Create()); try { subscriber.Subscribe(); } catch (Exception e) { } subscriber.publishConnectionInfoEvent += ConnectionInfoChanged; subscriber.publishAnalogInputChangeEvent += AnalogInputChanged; ConnectionInfoChanged(mITMServiceProxy.GetConnectionInfo()); ARPSpoofParticipantsInfo aRPSpoofParticipantsInfo = mITMServiceProxy.GetARPSpoofParticipants(out bool isAttack); if (isAttack) { lock (Database.lockObject) { Database.ARPSpoofParticipantsInfo = aRPSpoofParticipantsInfo; Database.IsAttack = true; } } }
private static void HostPublishService() { publishServiceHost = new ServiceHost(typeof(PublishService)); publishServiceHost.AddServiceEndpoint(typeof(IPublisher), NetTcpBindingCreator.Create(), "net.tcp://localhost:7021/PublishService"); publishServiceHost.Open(); }
public void Start() { svc = new ServiceHost(typeof(MITM_Service)); svc.AddServiceEndpoint(typeof(IMITM_Contract), NetTcpBindingCreator.Create(), new Uri("net.tcp://localhost:7023/MITM_Service")); svc.Open(); Console.WriteLine("MITM Service ready and waiting for requests."); }
public DNP3ExtensionViewModel() { Position = ShellPosition.CENTER; AnalogInputPoints = new ObservableCollection <AnalogInputPoint>(); mITMServiceProxy = new MITMServiceProxy(NetTcpBindingCreator.Create()); foreach (AnalogInputPoint analog in Database.AnalogInputPoints.Values) { AnalogInputPoints.Add(analog); } }
public ARPSpoofViewModel() { mITMServiceProxy = new MITMServiceProxy(NetTcpBindingCreator.Create()); hostsList = new ObservableCollection <Host>(); hosts = new Dictionary <string, Host>(); hostsIPends = new List <byte>(); target1 = string.Empty; target2 = string.Empty; CheckIfAttack(); }
public void Start() { svc = new ServiceHost(typeof(ClientNMSService)); svc.AddServiceEndpoint(typeof(IClientNMS), NetTcpBindingCreator.Create(), new Uri("net.tcp://localhost:7002/ClientNMSService")); svc.Description.Behaviors.Remove(typeof(ServiceDebugBehavior)); svc.Description.Behaviors.Add(new ServiceDebugBehavior() { IncludeExceptionDetailInFaults = true }); svc.Open(); Console.WriteLine("ClientNMSService ready and waiting for requests."); }
public void Start() { //Database.SetInitializer<IncidentContext>(new DropCreateDatabaseIfModelChanges<IncidentContext>()); LoadCrews(); svc = new ServiceHost(typeof(IMSService)); svc.AddServiceEndpoint(typeof(IIMSContract), NetTcpBindingCreator.Create(), new Uri("net.tcp://localhost:6000/IMSService")); svc.Open(); Console.WriteLine("IMSService ready and waiting for requests."); }
private void CreateProxy() { string address = ""; try { address = "net.tcp://localhost:7021/PublishService"; EndpointAddress endpointAddress = new EndpointAddress(address); proxy = ChannelFactory <IPublisher> .CreateChannel(NetTcpBindingCreator.Create(), endpointAddress); } catch (Exception e) { throw e; } }
private void CreateProxy() { string address = ""; try { address = "net.tcp://localhost:3001/Pub"; EndpointAddress endpointAddress = new EndpointAddress(address); proxy = ChannelFactory <IPublishing> .CreateChannel(NetTcpBindingCreator.Create(), endpointAddress); } catch (Exception e) { throw e; //TODO log error; } }
public ClientNMSProxy() : base(NetTcpBindingCreator.Create(), new EndpointAddress("net.tcp://localhost:7002/ClientNMSService")) { }
public DMSProxy() : base(NetTcpBindingCreator.Create(), new EndpointAddress("net.tcp://localhost:5000/DMSService")) { }
private void CreateProxy() { try { EndpointAddress endpointAddress = new EndpointAddress("net.tcp://localhost:3002/Sub"); InstanceContext callback = new InstanceContext(this); DuplexChannelFactory <ISubscription> channelFactory = new DuplexChannelFactory <ISubscription>(callback, NetTcpBindingCreator.Create(), endpointAddress); subscriptionProxy = channelFactory.CreateChannel(); } catch (Exception e) { throw e; //TODO Log error : PubSub not started } }
private void CreateChannel() { ChannelFactory <IOMSClient> factoryToOMS = new ChannelFactory <IOMSClient>(NetTcpBindingCreator.Create(), new EndpointAddress("net.tcp://localhost:6080/TransactionManagerService")); ProxyToOMS = factoryToOMS.CreateChannel(); }
public SCADAProxy() : base(NetTcpBindingCreator.Create(), new EndpointAddress("net.tcp://localhost:4000/SCADAService")) { }
private void CreateProxy() { try { EndpointAddress endpointAddress = new EndpointAddress("net.tcp://localhost:7020/SubscribeService"); InstanceContext callback = new InstanceContext(this); DuplexChannelFactory <ISubscriber> channelFactory = new DuplexChannelFactory <ISubscriber>(callback, NetTcpBindingCreator.Create(), endpointAddress); proxy = channelFactory.CreateChannel(); } catch (Exception e) { throw e; } }