1

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?

ZygD
  • 22,092
  • 39
  • 79
  • 102
Karthik Mandava
  • 507
  • 1
  • 14
  • 27

1 Answers1

2

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

Community
  • 1
  • 1
Lorenzo
  • 3,293
  • 4
  • 29
  • 56
  • 1
    Thank you but where I can learn about TCP/UDP listener program.I am new to iOS so I am unable to find TCP/UDP listener code for iOS. – Karthik Mandava Jun 24 '15 at 12:24
  • Hi, but have you experience in Obj-c or Switf? If you look in the link, you can see a good start point to create a tcp connection. – Lorenzo Jun 24 '15 at 12:30
  • 1
    Looking at this guide – Lorenzo Jun 24 '15 at 12:32
  • Hi the server is developed in Windows C#. net. So I want to connect that server through iOS device. So I am thinking that I have to connect through IP address. Is it right ? – Karthik Mandava Jun 24 '15 at 12:58
  • Yes you have to know the IP address of the device. But if you want you can do this: From the PC you can send a broadcast message in the network using a UDP port. In the iOS, you can listen for incoming message in that particolar UDP port and send a reply when receive the message. When the PC receives the reply from the iOS device, it will know the iOS device IP automatically. – Lorenzo Jun 24 '15 at 13:49
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/81425/discussion-between-lorenzo-and-karthik-m). – Lorenzo Jun 24 '15 at 13:53
  • Yeah right now I have an idea about that like take the port address and IP address of the PC statically but the problem was I am unable to underdstand that socket programming . I have already seen that which you have gave the tutorial but I didn't understand. – Karthik Mandava Jun 25 '15 at 05:10
  • Right now I have port address and IP address and on PC the software is running which was developed in c#.net and it is listening which device is connected to it or not but I am unable to handle in iOS – Karthik Mandava Jun 25 '15 at 05:15
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/81521/discussion-between-lorenzo-and-karthik-m). – Lorenzo Jun 25 '15 at 11:50
  • Hi Lorenzo... How are you ?? – Karthik Mandava Jun 26 '15 at 07:45