Up
Authors
- Andrew Ruder (
aeruder@ksu.edu
)
-
Version: Revision 1
Date: November 8, 2003
Copyright: (C) Andrew Ruder
- Declared in:
- LineObject.h
- Conforms to:
- NetObject
LineObject is used for line-buffered connections
(end in \r\n or just \n). To use, simply override
lineReceived: in a subclass of LineObject. By
default, LineObject does absolutely nothing with
lineReceived except throw the line away. Use
line object if you simply want line-buffered input. This
can be used on IRC, telnet, etc.
Instance Variables
Method summary
- (id)
connectionEstablished: (id<
NetTransport>)aTransport;
Initializes data and retains
aTransport aTransport should
conform to the
<NetTransport>
protocol.
- (void)
connectionLost;
Cleans up the instance variables and releases the
transport. If/when the transport is dealloc'd,
the connection will be closed.
- (id)
dataReceived: (NSData*)newData;
Adds the data to a buffer. Then calls
-lineReceived:
for all full lines currently in the buffer. Don't
override this, override
-lineReceived:
.
- (id)
lineReceived: (NSData*)aLine;
Subclasses
must override this method.
aLine contains a full line of text
(without the ending newline)
Instance Variables for LineObject Class
@protected NSMutableData* _readData;
Warning the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically private, it is
intended for internal use within the package, and
you should not use the variable in other code.
@protected id transport;
Description forthcoming.
Up