How to connect iPhone to Windows PC through IP address in iOS? - ios

I am doing one demo for connecting iPhone to Windows PC for sending files and text to PC from iOS Device. Can anyone give me a solution how can I approach it?

You can start to study the socket connection. With a TCP connection you can send and receive data to / from PC.
Another way (to avoid the TCP connection) is to use UDP message: in this case you should write a UDP listener in your iOS App that listen incoming message on a specific udp port.
look at his link:
iPhone TCP/IP Socket Server/Client Program

Related

UDP Packets IOS 9 LTE Network GCDASYNCUDP

I have a basestation (beaglebone running linux) at my home which is connected to multiple cameras. I connect my iPhone iOS9 to the basestation via TCP and the basestation will stream the video of each camera to a specific UDP port. All is well.
I want to be able to see the cameras when I am not connected to the local network. When my phone is connected to LTE, I have the iPhone connecting to the public address of my router via TCP and with port forwarding, all data is forwarded to the basestation. I am connecting and talking just like it was on the local network with the TCP client. All is well.
The problem is when the video is streamed via UDP on a specific port, no different than when on the local network, the basestation has no problem sending the packets, but the iPhone is not receiving anything. I am using GCDASYNCUDPSOCKET and my cellular carrier is Verizon.
I am wondering if this issue is due to Verizon blocking UDP packets? Or possibly there needs to be something else done other than just binding the iPhone UDP socket to a specific port and calling the beginreceiving function. I feel if it works on the local network, it should work on the cellular network.
I have also tried to ping the address of my cellphone from my computer which does not work. I am guessing the reason is because the iPhone has blocked this. It should be no different than pinging the address of google or anything else.
Please give me some insight on the possible issues or work arounds. I don't think I need to port forward the UDP since it is only outgoing and my Netgear router does not limit any outbound traffic (from the router to the iPhone). I was doing all this TCP before trying to send the video via UDP. It is much slower waiting to receive acks for 5 cameras streaming live video. And when it doesn't receive a packet it backs up the buffer and causes more issues. Also I had an issue with the TCP packets combining together so then I had to implement some kind of custom ack which made the delay worse, or add an end of message, but then it slows down on parsing and since I don't know exactly what data is coming it made things more difficult.
UDP is the way to go, just cannot receive the packets at this time. My understanding is a lot of games use UDP and they work on LTE network, so I'm not quite sure what the problem is. Is there special UDP ports that only work with Verizon?

Can iOS app listen() to a socket?

Can iOS app listen to a socket to become a server of some kind? If yes, what are limitatoins? Can you connect to this server from outside of your iphone/ipad, can you connect to it from the webpage on the same iphone using the websockets?
Yes it can, to some extent. Check this topic:
UDP broadcast using CFSocket on IOS
What i was able to do was listen to packets sent on broadcast, or to my apps IP address. Then you can just make your own socket callback function that would react to received messages.
As to limitations of sockets and communication with other devices, most of it is described in Apple documentation.

How to receive UDP broadcast packets on a PARTICULAR interface?

On an iPhone I have created a UDP socket and bound it to the WLAN interface. I enabled SO_BROADCAST and I am able to send broadcast packets to the network (confirmed by a client running on my notebook.) But the UDP socket on the iPhone is unable to receive broadcast packets.
In my opinion this is a kernel bug, because not allowing a socket with SO_BROADCAST enabled to receive any broadcast packet, is a bad design decision.
The problem is further described here and here. The most popular solution to this problem is to bind to INADDR_ANY. However, it would be nice to be able to bind an UDP socket to only one interface while still receiving broadcast packets! Is there really no way to achieve this?
(When I bind a socket to 192.168.1.7 on a class C net (/24), it should accept packets sent to 192.168.1.7 and packets sent to 192.168.1.255!)
Thanks!
pls check below link may be it's helpful.
Receive udp broadcast packets ios
iPhone UDP broadcast and response
iOS UDP broadcast vs. PHP UDP broadcast
https://github.com/robbiehanson/CocoaAsyncSocket

creating a UDP connection with iOS and an embeddeddevice

If I have an iOS client and an embedded device that I want to communicate between the two with a WiFi connection using UDP, do I need to write a server (python or something) to facilitate the connection? I am trying to look online but there are a lot of ambigious articles.
Thanks
You'll have to write a server application for the device (iOS or embedded) that will be listening for data.
However, for a simple, single-client UDP connection, your server is basically just a UDP socket, which you bind to the port you want to use - and then start listening for data on. You don't need any connection-handling as UDP is connectionless.
On your client, you just send data to the IP and port of your server, and that's it.
I've done this myself, connecting my iPod Touch to a small ITX computer (running WinXP), to control a small mobile robot over WiFi.

Can I monitor traffic on my Incoming Dialup connection using Wireshark?

I am trying to create a RAS server in XP Pro. The idea is to log in to this server via a dialup connection. I have set up a new network connection via the New Connect Wizard in XP - according to this tutorial on techrepublic.
I am sure that the modem and the connection is working, I have tested it.
However, I want to monitor incoming network traffic on this connection. So I thought I would use Wireshark. The problem is that Wireshark does not list this incoming connection on the front page. It lists all my other network connections, ( e.g. my ethernet connection ) but not this one.
Whats the best way to monitor traffic on this connection?
Wireshark should be able to capture the traffic on your connection. I would check the protocol you're using for communication and make sure that Wireshark is monitoring those protocols. Also, I would make sure that Wireshark is actually capturing traffic on your dial up device. It sounds like it's currently monitoring your NIC card, not your modem.
I recently found Microsoft Network Monitor and it has ability to sniff on dialup adapter with Vista or Win7 as OS. Works great!
According to this Wireshark wiki page, you must use Winpcp 3.1 to be able to capture traffic on dial up modems.

Resources