I am having a little trouble with the windows 8 store apps. My question is simple:
I have a windows 8 store app on 1 pc, and the same app on another pc. The PCs are not in the same network, but have internet. I want to send a message (string/bytes) from PC A, to PC B.
How can I do that?
EDIT:
OK, the StremSocket connection works. I successfully sent data from PC A, to PC B. I will write a simple demo to demonstrate it. Now comes the tricky part - the discovery.
My idea is simple: Make an Azure service which holds a database whith the peers in the form (ip,port,timeout). There will be a few rules.
- When you make "server", the app will notify the service every 1 second for it's existance.
- When the service recieves data from an app in the form (ip, port), it will check if this entry exists in the database:
2.1 If yes - reset the timeout of the entry to 0
2.2 If not - insert the server in the database with initial timeout 0 - Every second the service will update the database by these rules:
3.1 Increase the timeout of every entry by 1
3.2 If an entry has a timeout>5 (has not reconnected for 5 seconds) - remove it.
I'm sure there is a smarter solution, but this one seems like little work, and I think it should work for my needs. What do you guys think?