iOS: Thirdparty Frameworks for Socket Communication available - ios

my Task is to send the G-Sensor Data nearly in realtime from an iOS Device to an Application running on a different Device (OSX, iOS, maybe Windows). From all I've read so far, a Socketstream seems to be the best choice for this kind of Task. Do you agree?
My Question is, since I have no experience in Socket programming, are there any third party Frameworks that make socket programming more easier? Maybe that they already created something that will reconnect after the connection was lost and such things like Error Handling? I guess that not everyone invents the wheel again while programming with sockets?
Thank you for any kind of information regarding this topic.
twickl

I would strongly consider CocoaAsyncSocket. It has very much all the callbacks you will need. There are also a version for Tcp and UDP as well.

Related

P2P Connection with Sockets on iOS

I'm doing one university homework, where I need to make the Chinese Checkers game work via sockets.
I've followed this tutorial on raywenderlich and it seems easy setting up the streams, but in this tutorial its used a local server to intermediate the connection, and I don't know how to make a server, so I kinda need to make the connection be p2p, but i don't know how I'm going to discover the IP and Port the app is running on iOS.
Personally, it's the first time I've seen about sockets and I really need help.
If you guys can teach me how to connect 2 apps to each other directly USING SOCKETS (otherwise my teacher won't accept it) or point me where I can learn how to make a simple server for this matter it would be really great.
P.S: I know I can use GameKit, MultipeerConnectivity and etc for it, but I'm really obligated to use sockets :/

Objective C message to all online clients

I have an iOS App where people can post something to their wall. Now I would like to make a function that, when a client posts something, everyone who is online (application active state) can see a message that tells them that someone just posted something.
I have been using Sinch.com, Quickblox.com etc.
Sinch is bad, delay and slow, and it cannot send messages to over 10 clients. And it's for chatting, not for notification.
Quickblox is good, but it has a really high price and it's for chatting too.
I have tried to use PushRemoteNotification, but this depends on whether users turn on notification permission or not. Even if they enable notification, it is really slow when I send a message to over 500 clients through Push, and also I don't know which devices are online, so I believe this is not a solution.
I am planning to use PHP Ratchet WebSocket server and use one of these WebSocket libraries for my app Objective-C SocketRocket client or JetFire, but this is just my plan. So do you think it's possible for a huge amount of online clients?
If there is anyone who has any better idea please help.
I'm not entirely sure what exactly you are looking for, but I've had a lot of success using Twisted, which is built on top of Python. It has good functionality for building socket connections that allow pushing data from the server to clients. Ray Wenderlich's site has a great tutorial on Twisted (and specifically using Twisted with an iOS app) that helped me quite a lot.
Alternatively, socket.io, which is built on top of node.js would probably suit your needs quite well.

Using Node js in Multiplayer turn based game in ios

Hope u guys are doing great.
I want to make a realtime turn based game in iOS .
I know this can be achieved by using GAME CENTRE in iOS , but i have to play this between browser and iOS app. WEB TEAM is using node js for making this game on web browser , they also suggested me to use node js in iOS game as well.
Have anyone has idea how to use node js for this kind of purpose.
Thanking you all! :)
You can have websocket server written in node js and then just connect to it from your ios app using some websocket library (hope it exists). Then sockets connected from browser and your app can realtime exchange information.
You could use a pub/sub messaging service like Realtime (the company I work for) http://framework.realtime.co/messaging/
Both your node.js server and your ios devices could exchange data through Realtime pub/sub channels, using the node.js and ios SDKs.
The cool part is that since it's a managed service you don't need to worry about the server and networking administration, Realtime will take care of that for you.
I'd like to add some words in favor of #Edgar's answer.
For production, using only WebSocket is not reliable. In environment where WebSocket is not available due to antivirus, enterprise firewall, and so on, a kind of full duplex connection over HTTP should be available utilizing long polling or streaming in terms of reliable real-time connection.
Also such connection might be disconnected for a while e.g. moving away from Wi-Fi zone and then some messages which had to send through that connection may be lost so that a way to recover such messages is required e.g. here is some messages you couldn't receive.
Therefore, you need a reliable framework to write such real-time web application. Here's features which are required to write a real-time web application I think. (It's called Cettia and I'm the author of that project. As it doesn't provide iOS client, it's not right choice for you here. Just focus on features and roadmap to see what features you may be needed and evaluate a framework you will choose based on them.)
On Node.js world, socket.io framework has a great community so I'm sure someone already wrote iOS client for socket.io. Anyway, make sure that the framework you finally chose has features you need to write your real-time webapp.

How can I make my iPad a TCP Socket Server?

Can anyone point me to an example or an explanation of how to get a server going on an iPad? I want to use TCP sockets and I've already downloaded the current AsyncSocket stuff but it's trickier looking than I thought. I've been researching but everyone talks about iOS as the client and some PC as the server. I would like to set up my iPad as a local server for a game I'm writing.
You can use the C socket api. Every valid C standard library is also valid in Objective-C. Here is a nice guide for programming sockets with C.

How do I increase the priority of a TCP packet in Delphi?

I have a server application that receives some special TCP packet from a client and needs to react to it as soon as possible by sending an high-level ACK to the client (the TCP ACK won't suite my needs).
However, this server is really network intensive and sometimes the packet will take too long to be sent (like 200ms in a local network, when a simple server application can send it in less than 1ms).
Is there a way to mark this packet with a high-priority tag or something like that in Delphi? Or maybe with the Win32 API?
Thanks in advance.
EDIT
Thanks for all the answers so far. I'll add some details. My product has the following setup: there are several devices that are built upon vehicles with WIFI conectivity. When they arrive at the garage, those device connect to my server and start to transmit data.
Because of hardware limitations, I implemented a high-level ACK to make the device aware that the last packet arrived successfully (please, don't argue about this - the data may be broken even if I got a correct TCP ACK). However, if I use my server software, that communicates with a remote database, to issue this ACK, I get very long delay (>200ms). If I use an exclusive software to do this task, I get small latencies (<1ms). So, I was imagining if I could just tell Windows to send those special packets first, as it seems to me that this package is getting delayed so the database ones can get delivered.
That's the motivation behind my question.
EDIT 2
As requested: this is legacy software and I'm using the legacy dclsockets140.bpl package and Delphi 2010 (14.0.3593.25826).
IMO it is very difficult to realize this. there are a lot of equipment and software involved. first of all, if you communicate between 2 different OS's you got a latency. second, soft and hard firewalls, antiviruses, everything is filtering/delaying your package.
you can try also to 'hack' the system(this involve some very good knowledge on how the frames/segments are packed/send,flow control,congestion,etc), either by altering it from code, either by using some tools like http://half-open.com/ or others.
In short, passing MSG_OOB flag to the send function marks the data as "urgent". Detailed discussion about the OOB in the context of Windows Sockets implementation specifics is available here.

Resources