PDA

View Full Version : Network in IOS



feelthat
04-09-2013, 09:13 AM
Dear all:

I want to use class NetSocket of proton to read and write data in IOS

Do i need startup like win32-WSAStartup in ios

Have any idea startup socket in IOS?

Seth
04-10-2013, 12:20 AM
Everything works in iOS, you just do:

NetSocket s;

s.Init(ip, port) to be the client that connects to the server

or s.InitHost(port) to be the server

Then start using s.Write() and s.Read() to get data.

Oh, you do need to call s.Update() each frame.

No WSAStartup is needed. But initting the sockets may fail for a few seconds on the first connect in iOS, so be sure to check the return values and try again if needed.

feelthat
04-10-2013, 03:38 AM
thanks a lot


Everything works in iOS, you just do:

NetSocket s;

s.Init(ip, port) to be the client that connects to the server

or s.InitHost(port) to be the server

Then start using s.Write() and s.Read() to get data.

Oh, you do need to call s.Update() each frame.

No WSAStartup is needed. But initting the sockets may fail for a few seconds on the first connect in iOS, so be sure to check the return values and try again if needed.

feelthat
04-10-2013, 08:01 PM
App game "Tanked" or anyother game

1.does it use NetSocket connect to game server or use http Request?

2.server send data to client, use socket or ios push service?

Seth
04-10-2013, 10:14 PM
App game "Tanked" or anyother game

1.does it use NetSocket connect to game server or use http Request?

2.server send data to client, use socket or ios push service?

Both Tanked and Growtopia use ENet (http://enet.bespin.org/) (udp) primarily for communication.

Both games also download files via http using Proton's NetHTTP which uses NetSocket (over tcpip) as well.

I don't use iOS push events, everything is multi-platform friendly.

feelthat
04-11-2013, 01:41 PM
thanks again


Both Tanked and Growtopia use ENet (http://enet.bespin.org/) (udp) primarily for communication.

Both games also download files via http using Proton's NetHTTP which uses NetSocket (over tcpip) as well.

I don't use iOS push events, everything is multi-platform friendly.