Can Silverlight use the LAN without an internet connection? - c#

I understand that trusted silverlight applications can communicate with each other over the LAN connection (peer to peer). Can they do this without an internet connection once installed out of browser? Do they need to first download some sort of Access Policy?
If not, is there some alternative way of doing this, perhaps with some kind of helper service on the computer?
Can they use similar techniques to talk to Local non-Silverlight devices, e.g. could a trusted silverlight application talk to an iPhone app over a local area network?

System.Net.Sockets.UdpAnySourceMulticastClient
Does allow you to connect between Multiple Silverlight applications on the same LAN. It does not require any internet connection after the application is installed out of browser.
I'm not clear if this could be used for communication with non-Silverlight applications althouh I believe it probably could since UDP Multicast is a standard protocol.
In situations where the network infrastructure is older it may not support UDP Multicast addresses. In this case, the best solution would be to install a separate local server on one of the client machines, to which all other silverlight applications could connect (once the user had typed in the IP address).

I'm not sure where you got your information from but as far as I'm aware there is no builtin way for Silverlight applications to connect to each other peer-to-peer. However it is possible to place a simple server application on the LAN through which Silverlight applications running on different nodes can communicate.
The plumbing needed to create peer-to-peer pipes is missing from Silverlight. It only has a means to connect to a specific TCP/IP port or to listen to Multicast UDP sources, it can't create a Listening port that waits for a connection nor generate UDP output.

You could go this by calling COM objects from Silverlight, however
Just because you can hammer in a nail
with a screw driver, does not make the
screw driver the best tool for the
job.
Have a look at using WPF so you get the full .net framework.

Related

C# server-client implementation with TCP

I want to create a simple messaging app that uses tcp protocol to communicate, including with multiple people. Messages get sent to the server, which distributes them to all other clients. At the moment, I have it fully functioning and it works perfectly - on a local computer and a local network, using the ipv4 address.
After an extensive Google search, I discovered that to communicate from a different network I need to port-forward my server. However, how do I make my server able to communicate with clients without all the clients port-forwarding? As far as I'm aware, not everybody's device is port-forwarded.
So, how do I implement this? Is it possible with just C#? Or did I misunderstand something, and port-forwarding isn't really required?
Thanks for all the help.
Why don't you use SignalR. I think it will be best for your problem.

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 ?
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.
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
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.

WCF (or alternative) Controller-worker setup on machines across the internet

We have a .net monitoring service that runs on several PCs installed across the UK at client locations. We need to be able to communicate with these pc's from a central web application in order to send them individual commands and request data from them.
These PCs all have internet connectivity but may be behind firewalls. Because these PCs may not be contactable directly from a URL, we need some way for these "workers" to connect to the centralised sever, identify themselves, and then respond to commands from the server.
We are looking at WCF P2P as a solution, but have a few concerns about this (can you target an individual worker with this, and will we suffer problems with NATs and firewalls). We also considered using XMPP as a protocol to communicate.
Is P2P the way forwards, or is there a better solution (either WCF or otherwise).
Thanks
I suggest using netPeerTcpBinding.
There is a good article here.

Instant Server-Client Communication, C#?

I have been doing research for a few months now on the possibility of client-server communication. I have experimented with many methods such as WebORB and FluorineFX, which are both servers designed to deal with client/server authentication.
WebORB only runs on Windows for their .NET version as far as I can tell, and I would much rather use an open source system. I have tried using FluorineFX, but I think their must be a simpler way for me to build my own simple system from the ground up.
I have been using Dropbox for a while now, and I like the way that the client-server communication is instant. As far as I can tell (from some Google searches) the client doesn't open a port of its own, and just communicates with the Dropbox server through port 80. An example of its instant communication is where you may delete a file on Dropbox on their website, and instantly the server communicates with the client telling it what has happened. I don't know how this instant communication is possible without opening a port.
I can create a system that uses fetching from the client, asking the server every 10 seconds or so to see if there are any updates, but I would like a method to be able to push the information from the server to the client.
My server runs Linux so I don't think I can use WCF, and ideally I am looking for a way to make PHP and C# communicate with each other.
I would love to hear any advice that anyone has and how they deal with the problem.
Cheers.
You CAN use WCF to communicate with any platform. Just make sure you're using an endpoint which your target machine support: http://msdn.microsoft.com/en-us/library/ms733107.aspx
Have you tried the good old .NET Remoting which runs perfectly with Mono?
You can choose between a TcpChannel (for performance) and a HttpChannel (to pass proxy/firewall easily).
For push notifications, you can open a connection to your server and wait for an answer indefinitely.

Establishing IPC link between a Java app and C#-based plugins

We have a Java app, as well as a number of C#-based plugins for other apps (e.g. Excel) that can communicate with the main app. The communications layer is implemented using Apache MINA on the Java side and xsd for the .NET plugins. Typically things run on the same (Windows) machine, though it would be better not to assume that (e.g., allow the main app to run on a Mac and be able to communicate with Excel on a different machine).
The communication has to work regardless of whether the main app or the plugin(s) start up first. My question is how best to establish the link? Currently, our main Java app listens on a port that the plugins constantly poll for availability. This is obviously wasteful and inelegant. But it works.
An alternative would be to have each plugin listening on its own port, and when the app starts up it sends a "Hello" kind of message to each known port (on localhost), and then have the plugins establish the link at that point.
I've also looked a bit at multicast, but don't really know much about it. And of course, there could be multiple users on the same subnet all using the app.
Any other ideas or thoughts?
You should not be concerned with wasted attempts to connect to the server - it is not a resource intensive operation and the plugin requires the connection to work. There does not seems to be any real motivation to use anything different from a traditional client/server approach which you already are doing.

Categories