Networking for two devices (MAC Computer & iPad)

Dear All,

I have write a simple lucky draw programme in MAC computer, but the programme was not good enough, because i have to trigger the draw from my MAC computer.

To make it better, i was thinking to write a simple iPad programme that have only one “Draw” button. Which mean, the user just press “Draw” in iPad, and my MAC computer will start to draw.

Well, this involve connecting my MAC computer with iPad through network.

I understand that i need to use TCPSocket in my programme. But unfortunately, after several days of searching, i have no idea where to start.
The XOJO book does not lead me to the solution. The example in internet mostly cover bit and pieces.

I think why i am stuck is because i never get to understand the process of how two device communicate.

This is how i think the devices talk. Am i missing anything?

  1. I need to use TCPsocket to set up a port in my MAC computer. (say port 1500, must exceed 1024 i guess)
  2. I need to use TCPsocket to set up a port in iPad. (say port 1500, must exceed 1024 i guess)
  3. Then i let my MAC computer go into wifi network (how this can be done?) and find iPad (how to do this?)
  4. Then i let my MAC computer connect to iPad.
  5. Then MAC computer can communicate to iPad.

Do i miss out anything?
a. conventionally we are using networking cable, so this could be straight forward, but now all become wireless (WIFI), so where is this WIFI come into picture?
b. Most of the internet documents only mention setting up the port, i assume that port is just a way where data is send out from computer or iPad. How about the identity of computer/iPad, how to let MAC computer find iPad (or iPad find MAC computer). Is it recognise purely base on computer name or iPad name.
c. How about after recognise my computer/iPad, how to connect to the application that i am running?

All of this has been in my mind, but i really could not figure a way, which process first, or whether it is needed.

Please help

Whether the devices are wired or wireless or a mixture, it doesn’t matter too much… I’d take a look at EasyTCPSocket and AutoDiscovery

EasyTCPSocket allows you to write networking client/server and not have to worry about writing a protocol… There is an example project with Xojo that creates chat software using the EasyTCPSocket…

AutoDiscovery allows your Mac software (the server in your case) to broadcast it’s availability to your iPad (the client)…

Any questions, feel free to ask (I haven’t used the EasyTCPSocket or AutoDiscovery, so I might not be able to answer all your questions)