Do popular applications use sockets to communicate with server or other clients? - sockets

I recently coded a simple program that uses sockets to communicate for a synchronization of two clients. Then I'm wondering now if popular applications such as game agents(ex. the League of Legends game client, Steam game manager agent, etc...), streaming services(ex. youtube, twitch...), os update agents(windows, linux, mac os...) and so on are using sockets at the very bottom of whole communication among computers, or else there are proprietary architectures that are used only for those applications' communications respectively.
if those popular applications use sockets basically, please recommend books that tell about the architecture of programs using sockets with somehow reliable structure(that is, programs that can handle the broken pipe problem and other well known problems for sockets).
Thanks in advance for all answers!

Related

What would be the software architecture of a videogame?

I'm developing a videogame under Unity. I've been asked to describe the software architecture of my project. My videogame won't be using databases nor it will be connected to a server, it is a platform adventure kind of game with one player.
I have heard of other architectures like client-server, peer-to-peer, service-oriented, but can't find the one that truly fits a videogame.
Without further informations nobody can help you. You need to tell us more about your game.
But I guess you program a multiplayer.
Client-Server
In short every player (client) will connect to a server and this server will mostly do all the work what happens in your game.
Peer-to-Peer (P2P)
Here, there will be only one host (server) and every client will connect on it. Because of this, there will be some problems if the host is far away from the clients and more. Basically if you are the host it is much easier to cheat because you are the server.

Is there a solution to connect a Web app to a Modbus PLCs

I'm developing a Web application with HMI capabilities that needs to interface with multiple Modbus RTU and Modbus TCP PLCs:
frequently update the web UI based on the state of the Modbus devices
send commands to Modbus devices based on the user's input
What is the best way to integrate a Web application and a bunch of Modbus devices, given the requirements?
have you looked at modbus bridges (or Modbus-RTU to Modbus-TCP converters)? and the 'middle-man' software we use at our place is Kepware which then talks to our SCADA package (Cimplicity for us). Not sure if you're still in need of any more info on this, just shout back and i'll fill you in a lot more :)
Also, does this need to be a low cost solution (you could pretty much do this with off the shelf hobby hardware) or a full-blown industrial solution? Doing a dead simple SCADA bit and then talking to the plc's shouldn't pose too much of a headache if you have the time for it.

Any advice for iPhone Wireless Comms with Embedded Linux Device?

I am looking for advice on protocols for use in LAN comms between an iPhone and an embedded Linux device. The embedded Linux device requires the following functionality...
Connectible to Wireless LAN.
Discoverable as a device on the Wireless LAN.
(Virtually) connectible with iPhone.
Remotely Callable API provided to the iPhone.
Able to remotely call back functions on the iPhone.
I am looking to use platform independent protocols to achieve this functionality because the mobile application will be ported from the iPhone to other mobile platforms like Android. Since I am a newbie with Embedded Linux, my research (and possibly naivety) suggests that said functionality could be realised with the following protocols...
DHCP for obtaining dynamic IP address.
DNLA? (Bonjour is native to iOS right?)
Connection-oriented communication implies TCP.
SOAP or REST architecture on HTTP.
SOAP or REST architecture on HTTP.
Can you suggest other, more suitable protocols? Am I barking up the wrong tree? Is there a much more simple way I could achieve this functionality? For example, providing the remote API using only a TCP socket?
Any advice you can offer is welcome...
Look into 0mq. It's a scalable messaging library that provides a message queue without requiring a message broker.
-Has objective-c bindings to help you implement in iOS
-Has java bindings to help you implement in Android.
-Small footprint.
I did something similar - an Arduino that streams data to an iPhone app connected over WiFi using the UDP protocol.

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

What is the best way to implement a Server-Client connection between an iPad and multiple iPhones?

Based on a college-project I'm trying to realize a relatively simple game (Poker) where an iPad acts as Server and multiple iPod-Touchs connect to it as Clients.
Gamekit seems to drop out, since those old ipod-touch-devices don't have bluetooth-support.
Are there already some Frameworks out there simplifying the process, or do I have to fall back on TCP-Streaming-Sockets and implement it myself?
For your task I suggest you have a look at ThoMoNetworking or AsyncSocket.
ThoMoNet is a very simple setup that is specifically developed for fast and easy prototyping and easy to set up. Is will automatically create a bi-partite graph between all instances of you application it finds in the local network. So If you keep your iPad as the server and the iPhones as clients this will come down to less than 10 lines of code to set up.
AsyncSocket is a commonly used framework with ports to PC as well but requires more code to write. On the other hand it will allow you to do more fancy things, should you need them.
Distributed objects are not yet available on iPhone OS, so excluding GameKit you may try using Bonjour networking. Otherwise, you may try using web services with some of the available libraries. If Bonjour and web services are not a choice/possibility, then you have to revert to old plain sockets.