Adam
Adam

Reputation: 173

Two-way Communication between Server and Clients

Situation: We have a web application running on a server. This application needs to fetch data from some other PC(Clients), which are on a different network.

On the clients' pc there are WCF hosted in Windows Services using its their local Sql db. i want to make duplex communication between server and clients for share data with each other. data share mean share data-table,data-set,string etc between clients and server .

Problem :

1) I have no control over the firewall, proxy, NAT on the client side PC. Mostly company Employee PCs have lots of network security e.g firewall block ICMP traffic and some port too, some Router might be Disabled port-forwarding etc etc , client can change network place. I don't want to make any setting on client side Router,proxy,firewall though . during communication how can i handle that's kind of issue of client side? as you know skype is working perfect in that situation.

firewalls very often block inbound connections to clients; the client may not be reachable from the server, it may be using NAT translation behind a router and so cannot be contacted without port forwarding being set up on the router and some new router disabled port forwarding .

2) On clients side there is no IIS .

I don't want to allow remote access on clients PC.

There are more than 100 Clients and only one Server. one server need communicate with many clients on different network .

3) One side my client application is using window application and wcf hosted in window service ,Other side on my server i'm using Web application . so its mean communication is between desktop pc and web pc , that's issue .

If both using a web application then it was not issue to make duplex communication.because i know WEBRTC is fit there lol.

Technology which i had already test and find issue

WSDualHttpBinding: Not work if client behind NAT. check this for detail click here

MSMQ : its bad technique if clients more than 1 and performance issue also because its use RAM memory . check here click here

Xsocket: Its also not work if ICMP traffic block by firewall on client. check here click

WebRTC: Its work fine but its support web to web communication .as my client side i have win app.

Socket.io: Its need to set up node.js and many other thing , hard to implement because i need implement on existence application , i am not making new application.

C# Socket Program: Its wouldn't work if client behind NAT.check here click for detail

Service Bus relay: Its not free even for testing .

socketPro: I studied i find its good but i can't find any right sample on google .so that i could test that.

Genuine Channels: I can't find any sample on google .

Lets see SignalR issue .: Server side i run a console application and Client side i run two application ,one is console and other web. when i was running console client application than it was not initiating connection with Server but when i was using web client application then it was working fine. sample link is here SignalR two way communication I can't understand why thas??

Please tell me What is best most secure and fast way to handle this situation? what approach should i use ?

Upvotes: 3

Views: 8973

Answers (3)

Arthur Kater
Arthur Kater

Reputation: 856

I'm using SignalR extensively to communicate between the servers (C#), between server and mobile apps (C#, Xamarin, iOS, Android). The servers are at different locations and the mobile apps can be anywhere. It all works very reliable.

Take a look at: http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host and here http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-net-client

Upvotes: 2

Mike W
Mike W

Reputation: 318

SignalR seems to fit for this solution, because it's flexible. It negotiates the fastest available channel of communication and that is what you are looking for.

You should investigate the problem with it and signalR will eventually work.

Upvotes: 5

xIcarus
xIcarus

Reputation: 378

I've been working in my spare time with sockets (admittedly in c++, not c# but there shouldn't be a difference), and I've never had an issue connecting to clients behind a firewall/router, even without port forwarding.

Routers and firewalls generally don't like server-like programs, eg. programs that bind the socket to a port number. Does your client do anything related to binding? Because it shouldn't.

Needless to say, I would suggest a socket program. The way I see it, it's the most flexible way.

Upvotes: 0

Related Questions