I am writing a desktop application that will have to communicate with a windows mobile application in the compact framework 3.5. The communication must occur over the internet between these two applications to send data between them on command if the connection is available.
The system will send messages and objects like Images between device and desktop application and check to see if the desktop can see the device by sending a command and have a timeout on response. (Application will then know that the device is not available).
The mobile device will send a message to the desktop application when online as well that the desktop knows that the mobile is connected(Type of registering for communication)
Can someone please inform me of the best way to follow to accomplish this.
I did some research and found this site is near to something like event based driven communication I would want but do not have the availability of setting up an email on each device.
Battery life and internet open on device is not an issue.
Should I check in on working with the System.Net.Socket class for this type of communication between the two application and if so how will I set up so firewalls will not interfere and have my desktop application be seen over the internet by the mobile application ?
Hope someone can spread some light over this for me, if you have a answer please provide a link so I can read up on it.
your description is something basic. OK, regardless of what TCP/IP communication you decide for (HTTP, sockets) you must always have your internet router forward packages on a specified incoming port to your PC and the firwall must accept these incoming requests.
So, the device will have to send data to the PC and vice versa. So you need a server and a client on the PC and on the PC.
Possibly you can use an already available cloud like Dropbox to exchange files between PC and device.
What are about your skills in socket programming? The main server (PC) must be written multithread to be able to server multiple device client requests.
A simple socket comm is done in my SocketWedge [http://www.hjgode.de/wp/2010/05/27/transmit-data-from-winmo-device-to-pc-socketwedge-and-socketsend/]. A way of multithreaded communication using a web server on the device is available here [http://www.hjgode.de/wp/2012/10/19/windows-mobile-a-simple-web-server-with-extended-features/].
Will SQL with data synchronization be a possible choice?
Can you describe the application in more detail?
~josef
Related
What I want to implement is UWP-based programs and other C# programs are trying to communicate with Socket on one PC (Windows 10 Pro).
I have tried to make UDP communication module using DatagramSocket class and TCP communication module using StreamSocket class (https://msdn.microsoft.com/ko-kr/windows/uwp/networking/sockets) and it seems that module is not working properly.
In the Windows UWP example program and some developer forums, I saw a statement that it is impossible that socket communication between other programs on the same device.
I am wondering if it was the right I understood.
Also, if it is right, Would you recommend other ways to solve this problem?
I saw a statement that it is impossible that socket communication between other programs on the same device
It is right. According to the note of DatagramSocket official sample:
Network communications using an IP loopback address cannot normally be used for interprocess communication between a Universal Windows Platform (UWP) app and a different process (a different UWP app or a desktop app) because this is restricted by network isolation.
We cannot communicate a uwp app with other apps in a same machine.
Also, if it is right, Would you recommend other ways to solve this problem?
By testing on my side, if you use a c# console project as server and a uwp app as client, they can communicate successfully both with StreamSocket and DatagGramSocket. But following special steps need to pay attention to let it work.
Please ensure the Internet(Client&Server) and Private Internet(Client&Server) capabilities are enabled.
Run the server side as administrator.
Allow the network access promoted by windows when you run the server.
I wrote a demo which contains server side and client side of UDP and TCP. You can download here for testing.
And the results.
Although this can work, I recommend you to not use except for developing purpose.
Currently we have windows desktop software that is installed at customer premises and the software is polling a WCF service every 10 mins for updates on data.
I wanted to change this a real-time so when there is a update on server it pushes data back to the desktop client or web client.
The desktop client may be offline i.e. PC can be switch off or application is not started. In this scenario we would like to messages or updates to be queued
As we only support windows desktop client application so I will be using .Net technology.
This is the architecture that I thought of, please let me know if there is a better way to achieve.
NServicebus is another excellant tool for this type of thing.
Please consider streaming / queue platforms such as:
Tibco RV
Aleri
RabbitMQ
Consider Microsoft message queue: https://msdn.microsoft.com/en-us/library/ms978430.aspx
For offline case you don't need any queue. The app will check for update when started. When online, you can keep open TCP or UDP connection to server and send update notification to client. It will be something like "Update notification service".
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.
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.
I'm new to understanding how interprocess communication works. I"m working with two applications on my localmachine, a Source Application and a Server Application. The Source application broadcasts files through a configured port on my pc. The Server application listens for those files and exposes them to the internet for users to stream.
I want to remove the Server application from the equation and write a new application to communicate with the Source application.
So far I have my application connected to the port and listening. I am able to receive a message from the port. The message i am receiving appears to be metadata, no file. My assumption is the Server Application sends a response once it has picked up this metadata information to obtain the file. Therefore my application needs to mimic the server application. However I have no idea how to respond to the source application's port.
1) Is there a tool I can use to monitor the communication between the Source application and the server application? I believe this would be a tool to watch for tcp messages? All the tools I come across appear to only look for http messages. Would a packet analyzer be of any use?
2) If I can't view the communication between the source and the server application, what else can I do? Is there a tool I can use to broadcast the meta information I"m receiving on a port, then point the server application to that port and receive a response?
Any resources to help me better understand this intercomunication process would be greatly appreciated.
Yes, you can use Wireshark. It can monitor any TCP (and mucn more) communication, including local.
Use Microsoft Network Monitor 3.3, very easy to use.