Problem in porting Chicken of VNC Mac application into iphone application - iphone

I'm porting Chicken of VNC Mac application into iphone application
I am having source code of Chicken of VNC Mac application which take vnc of any LAN connected mac. I have to do same with iphone app. So while debugging mac source code I am not able to figure out how that mac app establish an authenticated VNC connection?
My Current Progress
I have done some progress. Now i am able to connect any LAN connected MAC and can take VNC of it. But i think the way i am doing is wrong. Actually now i am calling unstoppable timer again & again for [conn startTalking] and making RFBConnection with server on every mseconds for uninterrupted connection. Is this is a right way ? But this arise a new problem i cannot scroll my vnc view because on every mseconds screen is refreshing with new RFBConnection. Can any one guide me ?
Its pretty strange that none of experts are sharing their views on
this thread

See section 7.1 (handshaking messages) and 7.2 (security types) of this page describing the RFB protocol.

This is a bad idea. Porting an existing complex application to a platform you do not know is a recipe for failure. Build some simple iPhone apps first, so you get a good feeling for how things are done on the platform.
Did you start by making a list of all Mac Cocoa code in there that is not supported on Cocoa Touch? And then build replacements for all of them?

Related

Establish Socket connection between window and iPad

I need to establish socket connection between window machine and iPads. So here window machine is a sever which can connect to one or many iPad. For window machine(server) code is already there.
So will it be any issue while connecting window machine with iPads using socket?? and what is the best way to do it ?
If you're asking for possible issues because one side is Win and the other iOS then you can be sure that's not gonna cause any issues.
Assuming you're talking about iOS TCP client - one good tutorial is here: iPhone Network Programming.
There is also Robbie Hanson's CocoaAsyncSocket: well written, easy to implement and comes with examples. Examples are OSX projects but can be quickly converted to iOS projects.

How to create a Mac/PC server app that interacts with iPhone/iPad App?

Can someone please point me in the right direction to create a Mac/PC server app that runs in the background and connects to an iPad app over the local WiFi network?
No matter how I phrase a search on Google it just brings up various apps like Remote Mouse and whatnot and no tutorials or even a hint of where to start.
I just need to send simple commands from iPad to computer over local wifi. A point in the right direction and I can likely fill in the blanks.
Thank you.
Thomas
EDIT: I am using web languages for the iPad version that I will build as a native app using open source tools.
OK, then. It actually depends on what you really need. I made the assumption you need real-time and perhaps binary data transfer.
Your best bet is to write your server application using standard C or C++ so it compiles on both as simply as possible.
If you want to avoid all the burden of writing a protocol for service discovery or asking users to enter the ip address of your server you will use a mDNS implementation for your server and your iPhone app.
If I were you I would try bonjour: http://www.apple.com/support/bonjour/
on iPhone You could start here: http://developer.apple.com/library/mac/#documentation/Networking/Conceptual/NSNetServiceProgGuide/Articles/PublishingServices.html
Once you have your sockets you will have to implement a networking protocol between your server application and your iPhone app.
You will have to be careful about byte ordering and little subtle problems with latency, disconnections and other problems inherent to networking and WiFi.
In windows you will want to register your application as a service and in Mac OS X/UNIX you'll probably want to deamonize it.
Good luck!

iPhone - Browsing iPhone files through computer

I want to be able to send files from an iPhone app to a computer. What would be the easiest way of doing this?
I've made simple server client programs before, but in those, the client has always needed to connect to the server before being able to receive messages from it. There is an app for the iPhone called iSimulate, where you put a server on a Mac (the iPhone simulator), and then you use the iSimulate app of an iTouch or iPhone to send touch events to the server. This app does not require you to type in an ip-address. Instead it presents a list of available computers that have this server up and running.
How exactly is this being done? Can a server broadcast a message over a network, w/o anyone being connected to the server? How does that work? How does a client listen for that broadcast?
Here's a video of the app I'm talking about:
http://www.youtube.com/watch?v=N3Qpd1ycZh4
alt text http://a1.phobos.apple.com/us/r1000/051/Purple/7b/07/70/mzl.mvwjifyc.320x480-75.jpg
That app may be using Bonjour.
I've seen similar apps use a peer-to-peer Bluetooth connection to exchange files between a iPhone and a desktop.

iPhone interaction between PC app and iPhone app using USB

I know since the 3.0 SDK we can use accessories, so my question is simple, what is the process to make an iPhone app and PC (or Mac) app interact, using the USB ?
I don't ask you any code, but just the paths and the keys for making that work.
Have I to access the iPhone disk through SSH and work with files ?
Or can I send data from the iPhone app and intercept (get) it on the PC app (and send data from PC to iPhone) ?
Thanks, and if this question is stupid, just tell me, I didn't find on Dev Center (I don't really know what I have to looking for...) !
Edit : I read some news from Microids, they will synchronize PC and iPhone games (i.g here), and somewhere (I can't find it again) they say connecting the iPhone on the USB, so I think this is possible
USB access on the phone is only supported via the External Accessory Framework. You cannot hook the iPhone up to arbitrary USB devices, the devices actually have to support the EA protocol. You can get more details about it via the Made for iPhone program.
Other than that there is no USB access available on to applications.
You want the External Accessory Framework. Having said that, I'm not sure that Apple's intention was for you to communicate with an application on a PC/Mac. It's really for talking to accessories such as iPod docks, remote controls, etc. Apple may not allow an application that talks to a PC in this manner in the App Store.
You might be interested in ssh_relay (earlier called iphone_tunnel).
There is a /System/Library/Lockdown/Services.plist on your iPhone and you can start any such services via AMDeviceStartService and then communicate with it.
The ssh_relay demonstrates how to do that by having a simple port forwarder as a service on the iPhone site and the client application on your PC, so you can forward any local iPhone port to your PC. This is not exactly what you wants here (it is handy in the case you have already another service running on the iPhone which communicates via simple TCP and you want to access that; for example SSH) but based on this example, it should be straight-forward to have any communication between the service (in Services.plist) and your PC.

communicate with iphone via USB port on mac

So what I need help with is communicating with the iphone via a mac program. I don't want to do complicated stuff, I mainly just want to send the "screenshot" command, much like xcode does in the organizer window, however I want to be able to do my own things with it.
Check http://code.google.com/p/iphonedisk/
It uses MacFUSE. While it seems to have some problems it is a good start and I was using it a couple of years ago.
This site lists a way to connect to SSH through a USB connection:
http://oss.coresecurity.com/iphonedbg/usb_tunnel_doc.htm
It would be useful for a jailbroken iPhone.
As for other possibilities I haven't looked into, iphuc might be able to do get you just the screenshot capability without requiring you to be jailbroken. You will probably need to sniff them while running the organizer.