NNTP Connections in Objective-C

NNTP Connections in Objective-C

Post by Matthew Diephou » Mon, 07 Jul 2003 09:26:20



I'm in the process of learning Objective-C. I come from a Perl
background. I've done mostly CGI and NLP stuff. I find Objective-C
attractive because a) it's not Java and b) it's dynamic, not to
mention I want to do Cocoa programming.

For my first application, I want to write a newsgroup reader. I
haven't found any I like for OS X, and I need to write something.

Anyway, I don't know much about sockets and networking, but I quite
obviously need some code to connect to and communicate with nntp
servers. What could is there that I should use? I've looked at the
OmniNetworking framework, but am a little lost in it by the lack of
documentation and my lack of knowledge.

I do have a nntp Perl module I can port/translate, but I don't know
how to do the socket stuff in Objective-C. Is there some place I
should be looking for Objective-C code like Perl's CPAN?

Thanks for your help/time,

matt

 
 
 

NNTP Connections in Objective-C

Post by Christopher Culve » Mon, 07 Jul 2003 14:55:54



> For my first application, I want to write a newsgroup reader. I haven't
> found any I like for OS X, and I need to write something.

Alex Malmberg did an NNTP app in ObjC called LuserNet. It doesn't have
many features and isn't contributed to much, but it might be enough to get
you started. Note that it is a GNUstep (www.gnustep.org) app and probably
won't compile on Apple. However, much of the code within could be taken
out and used in your project. Note that is GPL'ed, however, so if you take
actual code and not just technical inspiration your project would have to
be GPL'ed as well.

You can find the app at
http://w1.423.telia.com/~u42308495/alex/LuserNET/LuserNET.html

Christopher Culver

 
 
 

NNTP Connections in Objective-C

Post by David Ste » Mon, 07 Jul 2003 15:51:55



> I do have a nntp Perl module I can port/translate, but I don't know
> how to do the socket stuff in Objective-C.

Since the Perl language uses mostly the same socket interface as in C,
it will be relatively straightforward to do it in C.

There is a MUD (multi-user dungeon and dragon game) in Objective-C,
that contains an amount of socket programming that you may want to see
as an example.  It is for Linux, on the www.ibiblio.org server somewhere,
see the Cheezmud game under /pub/Linux/games/muds.

 
 
 

NNTP Connections in Objective-C

Post by Matthew Diephou » Tue, 08 Jul 2003 02:36:10


After doing some more research, I found an article at stepwise (
http://www.stepwise.com/Articles/Technical/2003-04-22.01.html )
comparing networking frameworks. It even has some examples. I'm
looking at using either OmniNetworking, SmallSockets, or NetSocket. I
don't think I want to use OmniNetworking because of its large size.

Could somebody provide me with a simple sample for NetSocket like the
article provided for the other frameworks? I'm having a bit of trouble
finding how to do things by going through the source.

matt

 
 
 

NNTP Connections in Objective-C

Post by Paul Mitch » Tue, 08 Jul 2003 05:28:59


[..]

Quote:> Could somebody provide me with a simple sample for NetSocket like the
> article provided for the other frameworks? I'm having a bit of trouble
> finding how to do things by going through the source.

Have you seen this? <http://www.cocoadev.com/index.pl?NetSocket>
 
 
 

NNTP Connections in Objective-C

Post by Marcel Weih » Tue, 08 Jul 2003 05:34:02



>I'm in the process of learning Objective-C. I come from a Perl
>background. I've done mostly CGI and NLP stuff. I find Objective-C
>attractive because a) it's not Java and b) it's dynamic, not to
>mention I want to do Cocoa programming.

Welcome!

Quote:>For my first application, I want to write a newsgroup reader. I
>haven't found any I like for OS X, and I need to write something.

Great.

Quote:>Anyway, I don't know much about sockets and networking, but I quite
>obviously need some code to connect to and communicate with nntp
>servers. What could is there that I should use? I've looked at the
>OmniNetworking framework, but am a little lost in it by the lack of
>documentation and my lack of knowledge.

I know how you feel.  You might want to take a look at:

        http://www.metaobject.com/downloads/Objective-C/

There's an Nnntp.framework and the CocoaNewsWatcher.  This was a
quick port of (some of) NewsWatcher from the Mac toolbox to Cocoa,
with the low-level C socket/nntp functionality wrapped with the
Nnntp framework and the GUI part replaced by a minimal Cocoa app.

(It was a sort of wager in comp.mac.programmer.something, someone
 had claimed it would never have been possible to port NewsWatcher
 to Cocoa in anything near the 35 hours it had taken him to port
 to Carbon.  What you see in the download took about 10 hours...)

Marcel

 
 
 

NNTP Connections in Objective-C

Post by Matthew Diephou » Tue, 08 Jul 2003 12:49:37




> [..]
> > Could somebody provide me with a simple sample for NetSocket like the
> > article provided for the other frameworks? I'm having a bit of trouble
> > finding how to do things by going through the source.

> Have you seen this? <http://www.cocoadev.com/index.pl?NetSocket>

Yeah, I have. Unfortunately, the only code on that page is a large
example using bits of C I'm not familiar with to get the IP address of
a site. Then, another poster comments on how the whole thing can be
replaced with two methods. It's hardly the simple GET command example
I was hoping for.

matt