PDA

View Full Version : how to make a connection between Macs




Howiieque
Mar 15, 2009, 11:08 AM
I want to write an app send text between two macs like the msn do. I just want to learn how to do so and learn something about network. what should i learn to implement this task? and which classes can facilitate things?
and what if connect to a windows?



aaronw1986
Mar 15, 2009, 12:38 PM
I wrote soemthing exactly like this just last year in one of my programming classes. I'd look into C with emphasis on pipes

Howiieque
Mar 17, 2009, 11:15 AM
could you give a little more hints, about pipe?
and it seems that socket can do this thing, is there another option?

aaronw1986
Mar 17, 2009, 12:52 PM
http://beej.us/guide/bgnet/output/html/multipage/index.html

Catfish_Man
Mar 17, 2009, 01:43 PM
Cocoa distributed objects is also a nice way to do this.

Howiieque
Mar 18, 2009, 11:35 AM
Thank you.:)

Krevnik
Mar 18, 2009, 02:00 PM
Yeah, there are two ways to do this:

BSD Sockets
Cocoa Distributed Objects

Either one will work. If you intend to make this app multi-platform in the future (Beyond iPhone and Mac), then I'd look into BSD Sockets. Otherwise distributed objects should be just fine.

GorillaPaws
Mar 18, 2009, 05:46 PM
These tutorials related to bonjour may be helpful to you:

Part 1 (http://www.macresearch.org/cocoa-scientists-part-xxviii-bonjour-and-how-do-you-do)
Part 2 (http://www.macresearch.org/cocoa-scientists-part-xxix-message)

Saladinos
Mar 18, 2009, 06:27 PM
Java's the easiest way to go. Give Java sockets a try.

Howiieque
Mar 20, 2009, 11:48 AM
Thank you for given all the information.
Sockets and distributed object are both what i want to learn, although i just heard of them and don't know what they exactly are.
And then i want to Windows join in by using Java.

Krevnik
Mar 20, 2009, 03:07 PM
Yup, look at sockets.

It will require more work on your part, but the code will be more portable. The same basic concepts will apply on any Unix-like system, Windows, Java, OS X, and so on.

It will also give you a bit more fine control over the data sent.