Re: Telnet Networking Example
Re: Telnet Networking Example
- Subject: Re: Telnet Networking Example
- From: DerNalia <email@hidden>
- Date: Thu, 23 Jul 2009 13:24:28 -0500
I have all this code I got from the Apple Developer site, It all sets
up correctly. Assuming I can trust my NSLogs, I should be connected to
my telnet server.
So, lets I say I want to send the command "!COMMAND ARG"
Since this:
- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode
sounds like it should do what I want, and NSStreamEvent is an
NSUInteger, do I just break up the command char by char, and send it
to this method?
On Jul 22, 2009, at 3:31 PM, Jens Alfke wrote:
On Jul 22, 2009, at 12:41 PM, DerNalia wrote:
I've been looking at NSStream for interfacing with a server that
accepts telnet connections, and haven't made much progress in my
understanding of how exactly to send / receive the commands /
responses.
Telnet is basically just sending keystrokes over the socket. So you
open the socket, send your command as ASCII bytes over the output
stream followed by a newline, then receive the response from the
input stream.
So I was wondering if there was is a framework or something that is
a bit easier to use than NSStream...
What are you having trouble with in particular? Have you looked at
Apple's sample code, especially CocoaEcho?
Eli Bach wrote:
You could try using libcurl. It supposedly has some support for
telnet, but you'll probably still have to wind up doing some
parsing of the data the server returns.
I don't think this would be any different than using NSStream,
except for the impedance mismatch of talking to a raw C API...
Lance Robinson wrote:
You might be interested in using /n software's IPWorks product:
A $300 proprietary library seems kind of like overkill for a newbie
who just wants to send and receive telnet data. :)
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden