Pergunta

I need to send and get packets via UDP and TCP in iPhones and the server. But, I figured that if I wanna send packets to a client (iPhone), he is... A kinda server.

So, let's say I'm sending and getting packets to iPhone via the port 2347. Do I need to open the port on the iPhone or something like that? Is there any Firewall built-in to the iPhone?

Foi útil?

Solução

No firewall on the iPhone. However, 99% of the time, the phone will not have a publicly accessible IP. It may be on wifi behind a router, or it may be on the cellular network most probably behind a NAT pool. Either way, you don't have access to any of those pieces of equipment, nor do your users in the cellular context (and potentially some cases of wifi usage). Think about doing this another way.

Outras dicas

There is no firewall on the iPhone by default. Provided you don't need the iPhone to act as a server, i.e., bind a port, you can have the server send packets back to the iPhone using the information in which they were received, i.e., IP and port, using the protocol of your choosing, e.g., TCP or UDP.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top