PDA

View Full Version : OS X Networking Programming




Soulstorm
Feb 27, 2008, 09:34 AM
I finally reached a stage, where I think I need something new to go on in my programming life. I decided to make an application that takes advantages of simple networking features of OS X.

A simple application I want to make is an IRC Client, or at least a simple chat program that can send messages between 2 different computers. That is an example of the type of a networking program

But I am really stuck. How do I begin? What technologies I need to know? I am fairly proficient in C++, and have great experience with Cocoa and ObjC. Any recommendations, or technologies I will need to take a look at?



Cromulent
Feb 27, 2008, 09:39 AM
I finally reached a stage, where I think I need something new to go on in my programming life. I decided to make an application that takes advantages of simple networking features of OS X.

A simple application I want to make is an IRC Client, or at least a simple chat program that can send messages between 2 different computers. That is an example of the type of a networking program

But I am really stuck. How do I begin? What technologies I need to know? I am fairly proficient in C++, and have great experience with Cocoa and ObjC. Any recommendations, or technologies I will need to take a look at?

Look into socket programming.

http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html

Here is the RFC of the IRC specification which you will need to know.

http://www.irchelp.org/irchelp/rfc/rfc.html

kainjow
Feb 27, 2008, 10:24 AM
There are several good Cocoa classes for networking. Check out SocketClasses (http://www.cocoadev.com/index.pl?SocketClasses) on CocoaDev. I'd suggest AsyncSocket.

x704
Feb 28, 2008, 07:03 AM
I started a simple IRC API in Objective-C; its still not quite halfway done. I'm not using the Cocoa framework as I want to keep it platform independent. Eventually when I finish the API a bot will soon follow. Text parsing in C stinks.. heh

Anyway, I'm just using sockets in C with TCP then wrapped up in nice classes in Objective-C. Eventually I will add support for more than one connection, but gotta get the parsing properly working first :/

You might check out Xchat-aqua, its open source... http://sourceforge.net/projects/xchataqua/
And don't forget the IRC protocol: http://www.irchelp.org/irchelp/rfc/rfc.html

I'm almost ashamed to show my code (lol); still has much that needs to be done, but https://launchpad.net/libobirc if you really want to glance.

Soulstorm
Feb 28, 2008, 10:13 AM
Thank you all for your answers. I considered taking a look into X-Chat, but I wasn't sure if that used the method I am willing to use. I think that simple BSD sockets will be fine for me. I will stick at that atm, till I need more.