Best way for a Mac application to talk to Windows applications - cocoa

I need to write an app on Mac OS X that would send remote command to Windows applications to perform some tasks. The computers will be sitting on the same subnet and the Mac and Windows computers all have a fixed IP.
The data sent over really are just some string or boolean parameters so that the Windows app can perform specific tasks.
Someone will be writing the Windows app and I will be writing the Mac app.
I can find in the developer's doc about Mac to Mac communication, but nothing about what I need.
What's the best way to achieve this? What protocol is best suited for this?

Take a look at the Bonjour SDk for Mac and Windows: http://developer.apple.com/opensource/

There are (at least) two separate problems here:
#1 is how you discover the other app. Bonjour is one possibility, as is a local broadcast, as is explicitly configuring the hostname of the peer
#2 is how you talk to the other machine once you find it. For that part, I would suggest:
a) use TCP instead of UDP (in most cases), so you don't have to worry about retransmissions & sequencing
b) rather than inventing your own client-server protocol on top of TCP, use an existing one. I hear there's something called "HTTP" that's starting to catch on...

Could you just use UDP to broadcast a message out to the network? Your apps (regardless of whether they are running on Mac or Windows) can listen for the message and process them as needed.

Related

How to communicate with the USB Host from a Linux USB Client

The host part will be a PC program made from c# in which I will use LibUSBdotnet to do the communication.
My problem is how do I make the Linux side pickup and respond. I don't really know where to start.
Whenever I try to search for it, all result show are "how linux communicates with a device attached to it".
Or it does not matter if a device is host or client, because they utilize the same pipes/bus?
Can I use something in "/dev/usb***"?
I have seen "libusb" which I believe is the linux cousin of libusbdotnet.
Can I somehow use this library? If anyone can show me the right direction, I would really appreciate it.
AFAIK libusb is the library for usb-host side, not for usb-device side. So you cannot use it in your case. I suggest the same as myninjaname said - to analyse one of the Linux usb gadget drivers as a start point.

How can I sniff local traffic

I have WAR app A that calls app B. I want to sniff traffic between them. How can I do it? OS: Windows
Wireshark (http://www.wireshark.org/) is a useful tool for sniffing network packets. I had this kind of problem yesterday (although it was between a windows app and a device on the network). I had never used Wireshark before then, but I was able to use it and read through the data in a matter of minutes. I haven't tried it between two apps on the same machine, however.

Windows Phone 7 programming the use of the USB port

I would like to make a Windows Phone 7 application that takes advantage of it's USB port to communicate with the PC. I would like to write an application to control or push information/data to the PC from the application. But I am having problems finding information on where to start. Can anyone help point me in the right direction with some resources?
The only way to communicate over the USB connection is over HTTP.
To get this to work you'll need:
- a webservice hosted on the PC you're connecting to.
- a way for the app (on the phone) to know the hostname of the PC. (You'll probably need to enter it manually)
When you have these it should be straight forward.
You can't.
If you want to make sure to push data to a client PC, you will have to use a kind of synchronization by using the internet. For example create a wp7 application and a desktop application and let them sync the data based on a user object or anything like that.
As far as I know also the updated SDK for Mango will not support programming against the USB dataconnection.

What is the best way to connect remotely to a Mac?

I'm trying to remotely control a Macintosh computer. I know that in the Windows world, you can use Remote Desktop to connect from one Windows computer to another Windows computer. This works relatively well.
I know that you can use a VNC server but this isn't always the most secure or give the best performance. Are there other options available for remotely connecting to a Mac?
In some situations Copilot is a good solution. Not so much for day-to-day admin, but great for remote tech support.
If you need the solution to be cross-platform (ie, controlling an OS X box from Windows) then VNC is the obvious choice. I've had much better luck with the free Vine VNC Server than with Apple's built in one. As for viewers, Chicken of the VNC on OS X or Tight VNC on Windows are good solutions.
As others have said, for security firewall VNC and then use an SSH tunnel. There's lots of ways to do that, and the exact details depends on OS, firewall, network, etc. One method of creating an SSH tunnel for VNC is described here.
If you're trying to connect from one (Leopard) Mac to another, you can use the built-in Screen Sharing functionality; turn the server on from the Sharing System Preferences pane, and either use the network browser (on a LAN) or just open a vnc:// URL.
If you're trying to manage a bunch of Macs, try Apple's Remote Desktop (ARD) software; it's sold in 10- and unlimited-client versions, so if you've got fewer than 5 or so Macs it's probably not worth the money. The client bits for ARD are part of OS X. Screen Sharing and ARD use the same protocol, which includes some Apple-proprietary extensions to VNC which do encryption (either of all data, or of just keystroke/password info) and support adaptive JPEG compression, which gives you decent-enough performance (usable, but nothing like RDP or NX unfortunately).
If you need something cross-platform, check out TeamViewer (which will punch through firewalls and so forth).
Apple's Remote Desktop has AES encryption. Another good way is to just enable SSH in sharing and use shell access to perform tasks without interrupting the user.
http://www.apple.com/remotedesktop/
^That's your best solution.
If you go into the Settings panel, you can find a variety of other remote access options including SSH.
You can use VNC which is built into Tiger.
Yeah, VNC is good, but what about Apple's Remote Desktop?
If you are looking for a free, secure solution: I would recommend using any of a number of VNC servers that are available, blocking the ports that VNC uses to communicate, and then using SSH tunneling to connect. This way, ssh is encrypting everything, and you can still rely on free, open source (?), and cross platform standards for controlling the Desktop remotely.
Citrix, the people behind pc anywhere and the windows remote desktop have a hosted app called "Go to my pc" https://www.gotomypc.com/
I've heard people says it good.
I personally like RHUB's service for remote access and collaboration. It's an appliance that's easy to use and very secure. The device works from behind your firewall (instead of outside of it).
if you need low bandwidth or cross platform there's RDP server for mac that also offers there own iRapp protocol
from their site:
http://www.coderebel.com/2013/11/08/irapp-mac-client-available-download
Lowest supported speed: 512 kbit/s (64 KB/s) for iRAPP protocol
By adjusting the image quality you are able to make iRAPP work on
lower bandwidth connections as recommended above.
iRapp TS (Mac Terminal Server) allows multiple users to connect one
Mac simultaneously

Citrix Server sort of app - on a Mac?

Does anyone know of a similar product to Citrix Server that'll run on the Mac OS?
Essentially, I'm looking to allow multiple remote users to log in to the same OSX Server at the same time (with full visual desktop, not SSH).
OS X's Quartz window server has no remoting abilities, unlike its predecessor. X11 does, but 'native' OS X applications don't use that; of the few Mac apps typically run in X11 (such as GIMP or CrossOver), none are specific to the Mac, so you might as well run them on a different OS.
That said, if all you want is to visually remote-control a session, it is possible to use VNC or a derivative, such as Apple Remote Desktop. Since 10.4, this allows for multiple simultaneous sessions, as implemented with Vine Server. Remote Desktop also has other abilities such as remotely installing and updating software.
(Unlike Citrix and X11, VNC does not send drawing commands over the network; it instead transmits a compressed image representation pixel-per-pixel.)
You should specify your exact needs. You will not get a Citrix-like experience where you can run single Mac apps in their own remote session. You will, however, get remote graphical control, and that may be more than enough for you.
I've never heard of it, but from their blog:
Aqua Connect Terminal Server uses the VNC (Virtual Network Computing) protocol to send data between Mac OS X and the client application.
Now, if someone does know of a non-VNC solution, I'd be happy to hear it.
Anyone have experience with Aqua Connect? Found them from Google, and they claim the next version works on RDP as well as VNC. Wondering if it's just a nice wrapper around the VNC capabilities #Soeren Kuklau pointed out.
Thanks for the link to Vine Server, that's worth investigating.
John Vasileff,
Back to My Mac is a tunnelling / NAT traversal technique that enables the use of any networking (including VNC-based remote control). iChat screen sharing, Finder Screen Sharing and Remote Desktop all use VNC. Apple does not offer any non-VNC solutions.
Citrix XenDesktop iPhone Demo

Resources