How does a windows phone sockets game work ? Bluetooth? XBOX LIVE api ? - sockets

Must a game be client server which then requires me to stand up a server? If so, can I do that on a web host? Azure? ..
If not, then how do the 2 window phone clients find each other?
I am having difficulty understand the main blocks invovled in doing this and how they come together...
What about bluetooth ? From what I have read so far there is no access to the bluetooth api ?
Is there or wil lthere be any helpers from xbox live and thier api to let a indie dev set up connections ?

There are 2 options for creating a real time multiplayer game.
Devices connect over the internet or used a web based mediator to relay game data.
Devices connet via sockets over UDP.
If you choose option 1 then you can host your web based component anywhere.
If you choose 2 then there is a sample that may be of interest at http://msdn.microsoft.com/en-us/library/ff431744(v=vs.92).aspx
There is, currently, no support for working with BlueTooth in the API.

Related

End-to-End communication between two networks

I studied your article (CoAP) in https://www.rfc-editor.org/rfc/rfc7228.
we are developing Home automation Solution with IoT enabled devices.
I have following doubts to provide the seamlessly solution for Home Automation.
1. I have some appliance with Wi-Fi enabled controllers
2. These controllers are connected to One Standard Router (ex:- CISCO,TP-Link, D-Link). All appliance connected to one router through Wi-Fi.
3. These appliance controlled through local handheld devices by using our proprietary protocol with in the Home network.
Now, we want to give a one feature like operate these appliance by using Handheld device from Remotely.
Internet is enabled to this Router & also register one domain name.
But our problem is how to send commands or data from remote devices through Internet to home appliances.
Note:-
1.I don’t want to develop or place controller between IoT devices &
Remote handheld devices.
2. Request is initiated by remote handheld device only.
I hope, any body can guide to me for better solution.
Thanks in advance
Even if it's not a programming question I would like to make some references that can help you with decisions:
AllSeenAlliance AllJoyn Framework SmartHome Working Group. I think, it will guid you how to develop better solution.
HomeOS by Microsoft Research

Bonjour - one server multiple clients - ios iPhone

Im developing an app where one iOS device act as "server", and other devices are acting like clients.
Im getting hard time with understanding if I can make this using Bonjour
If I make an example:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
All devices have same app installed. All users are connected to the same WIFI.
User must login into app, and when it does, chat rooms are populated from CMS (web server) from internet.
All of them see e.g. all "chat rooms". But at the beginning chat rooms are all read only. Anyone can browse these, but nobody can write into them.
When administrator (user with admin privileges) opens one of the chat rooms; all clients are now able to write into "open" chat rooms.
Of course when one user writes something down, the other users see the newest comment from him.
Administrator should see all clients in chat room but clients cannot see each other.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
All samples which I have found (WiTap, videos from WWDC,...) are using two devices only. I've installed WiTap on 4 devices. And I can establish connection and working "sample" game with two devices.
Can Bonjour service be used in such way that multiple cients are connected to one "server"?
Any hints are very welcome!
Yes, Bonjour can be used like that: for example Apache on Mac OS X has mod_bonjour so that web browsers can find a web server on the local network. That can mean having one server but multiple browsers: exactly the situation you describe.
One limitation is that the way Bonjour is configured in iOS means that the server and clients need to be on the same local network. It doesn't sound like the situation you describe is compatible with using Bonjour in that way, but then I also don't think you need to. You can use the DNS name of your chat server in the app, so any app can discover the server. The server can also be responsible for discovering which clients are connected and allowing people to find each other (indeed, I guess that's what the chat rooms are for).
This is a good place to start. http://mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/ I have build the same Server and client with the help of chatty. But you will face one problem in iOS5 only, when the iphone will go to sleep mode, the socket connection lost. I am not able to solve this problem. So, looking for help. :)

How to do peer-to-peer communication in an iPhone app?

I'm trying to write a simple chat application for the iPhone (as an experiment). Is there a simple way for two devices to discover each others' IP addresses, and given the addresses is there a simple API or protocol that would let me send text messages back and forth?
I've investigated SIP (specifically Sofia and eXosip), but these tools exist as C libraries and are beyond my current ability to port them to the iPhone.
Update: I'm trying to connect two devices over the Internet (i.e. not over Bluetooth or a local wireless network, which is what GameKit does).
You're going to need a server that provides the match making service. Game Center makes this pretty easy, but your users will have to have Game Center accounts.
Alternatively, you can set up an XMPP (formerly Jabber, it's what powers Google Chat) server (I've never done this, but there are several available) and use the XMPP Framework for Cocoa. There are instructions for using it in iPhone apps here.
I'm sure there are other chat servers and client source also available. IRC and Mobile Colloquy come to mind.
Finally, you could write your own server using your favorite server language / framework. This isn't too hard (I've done it myself), but it's far from what I'd call simple, and I wouldn't use it for a production system.
There is support for exactly this kind of ad-hoc peer-to-peer networking in GameKit. Have a look at the second half of the GameKit documentation for details:
http://developer.apple.com/library/ios/#documentation/...
NSNetService is a good option.
Take a look at WebRTC Datachannels. WebRTC is a newer option with native iOS support a standard that is still being finalized, but it is more flexible should the iOS app need to communicate with browser or even android peers

peer-to-peer multiplayer game with xmpp

I'm fairly new to multiplayer games. I have made a few for my own fun, but nothing profound.
Anyway, I want to make a game that is very cross-platform. The clients would be connected with their facebook accounts on the devices I release the game for (most likely computers (via flash), iPhone, and android). I am a solo developer on a shoestring budget (actually more like no budget). So, I want to make the game with a peer-to-peer connection. I would like to avoid using a client/server setup because of the cost to maintain a server. The problem I am running into is there is no way to connect peers over the internet, and the game is not meant to be played over a local wifi.
So, I have an idea. Can I use facebook's built in xmpp chat to send the game's multiplayer communication over the internet? I have head of xmpp being used for multiplayer games before. Does anyone have any other ideas? I understand that xmpp can be connected peer-to-peer, but can it be done over the internet somehow. I don't want the users to have to mess with router settings to play.
Thanks for your help!
The main problem in P2P systems are NATs and firewalls. Firewalls can be locally opened, NATs cannot in 99% of the cases. In the IPv6 world there will be no NATs, so P2P will be free for all.
Now you want to use Facebook's XMPP APIs for P2P multiplayer. Well... Facebook's XMPP is practically client/server because of the above reason. All Facebook's APIs do is to hide the transport layer to applications, meaning that you can send messages to "another user" while they actually transit through Facebook server. Skype is another example of P2P+server environment. If two users stand behind a NAT, it automatically uses a proxy server.
This is mostly the same with FB's XMPP, so you can go with that, unless your facebook users will see lots of strange messages in their chat window :)
I think you cannot build a multi-player game just by using facebook jabber servers. You will need to have a custom jabber component sitting at your own server to enforce your game business logic on the xmpp packets transferred between the game users.
This will (probably) involve writing custom Jabber Component Protocol XEP-0114 and Bosh Connection Manager component at your end. If you are looking to use PHP for developing your application you can have a look at Jaxl library (XMPP component and client library in PHP)

How can an iPhone communicate with a computer?

How do apps like Apple's "Remote" app control mac applications and send data?
is this via php with exec() commands or some other method? and how would I do it in c?
Also, how fast is this rate of transfer (can I use it to send real-time data like streaming video or audio?)
thanks to anyone who cares to enlighten me on this issue :-)
Apps generally communicate using a TCP/IP based protocol and the wireless LAN connection (the iPhone also has Bluetooth). In the case of the Remote app the communication is via with the Digital Audio Control Protocol. iTunes implements DACP so the Remote app can control it. Other common protocols are HTTP and FTP. There are classes in the iPhone SDK to connect to noth HTTP and FTP servers. There is also the Cocoa HTTP Server project which allows the iPhone to act as a HTTP server.
iPhone apps can also use Bonjour/mDNS/zeroconfig (they're different names for the same technology) so that the user doesn't have to be concerned with configuring IP address'.
The data transfer rate of the wireless connection is faster enough to stream video.
many of these remote applications work by installing client software on the computer and establishing a network connection. In the case of Apple's remote software, the client software is built into the networking capabilities of iTunes. You must authenticate using your iTunes sign in and be on local wifi.
The third party app "intelliremote" works very similarly only has it's own client software to install and can work across a WAN with proper port forwarding enabled on your network.
I haven't encountered any realtime streaming options as most of these utilities are designed to pass control messages and meta-info on media files.