I think that technically you can. But only temporarily The app running the server āin backgroundā will be killed after a while by the iOS watchdog.
Ok, thanks for the reply. And for resolve this issue, I could check from the client if the server āin backgroundā is up? and run up if isnāt.
Kind Regards.
Well, if the server is down it wonāt receive data, so itās easy to find out when itās down.
But I think you can run both the server and the client within the same app.
That is the trouble, It canāt be the same app.
I was thinking in Check if is running the server app, and send the message when it is running, or start up wait a while and send the message.
In your experince it is possible?
Kind Regards,
AO
I donāt think so but Iām happy if you prove me wrong
Thanks funkyboy, I will try it.
Hi. Thanks for this example. I rewrote Objective-C client example on C++ for Cocos2d-x (iOS + Android cross platform game engine). Now chat is working for both mobile platforms.
@keepwalking cool. Feel like sharing it with us?
Iāll think about it. In begin, Iāll try to implement cross-platform real-time multiplayer on your examples but for cocos2d-x.
Hi, thanks for the tutorial!
I managed to make it work on the iPad simulator and also by using telnet (both on my OS and on another OS running on a virtual machine), using the IP adress of my computer and not ālocalhostā, but still I canāt make it work on the real iPad. I get the āCan not connect to the host!ā message, corresponding to the NSStreamEventErrorOccurred case.
What am I missing? Do I need to set something on the iPad itself? It is connected to the same wi-fi networkā¦
Thanks in advance for any help.
@opossum1189 Once you run the app on a real device there might be a few āinterferencesā:
- you are using cellular connection, which canāt know about a local IP
- your wireless is setup in a way that doesnāt allow connections on the port you are connecting to
- you server is running on a machine that doesnāt allow connections on the port you are listening from
These are just a few off the top of my mind
I think Iāve found the solution, I had to deactivate Windows Firewallā¦ I tried it yesterday but it didnāt workā¦ Anyway now itās working! Thanks!
Hello,
I am new for socket connection and each time following your guidance here. As per in tutorial I just wrote two lines in python file name id āserver.pyā
from twisted.internet import reactor reactor.run()
And simply run python server.py command in terminal and each time getting below error message.
Traceback (most recent call last): File "server.py", line 1, in <module> from twisted.internet import reactor ImportError: No module named twisted.internet
Can you please guide me for solve this issue ?
Iām using OS X Capitan and Python version is 2.7.10.
Hey there, I am thinking about writing a framework to easily deal with WebSockets in Swift 3. I know there is Starscream out there but that is on Apache v2 License. Is it worth that there is a Version with MIT License? What do you think=