IPhone to connect to another wireless device

If an iPhone was subscribed to a wireless network, are there any open tcp/udp ports? If so, which port can I use in order connect to another wireless device? Does iPhone allowed an incoming network connection; can we use softwares or any settings in order to block the incoming network connection to the iPhone?
