ObjFW
Loading...
Searching...
No Matches
<OFStreamDelegate> Protocol Reference

#include <ObjFW/ObjFW.h>

Inheritance diagram for <OFStreamDelegate>:
<OFObject> <OFStreamSocketDelegate> <OFTLSStreamDelegate> <OFSPXStreamSocketDelegate> <OFTCPSocketDelegate> <OFUNIXStreamSocketDelegate>

Instance Methods

(bool) - stream:didReadIntoBuffer:length:exception:
 This method is called when data was read asynchronously from a stream.
 
(bool) - stream:didReadString:exception:
 This method is called when a string was read asynchronously from a stream.
 
(bool) - stream:didReadLine:exception:
 This method is called when a line was read asynchronously from a stream.
 
(nullable OFData *) - stream:didWriteData:bytesWritten:exception:
 This method is called when data was written asynchronously to a stream.
 
(nullable OFString *) - stream:didWriteString:encoding:bytesWritten:exception:
 This method is called when a string was written asynchronously to a stream.
 
- Instance Methods inherited from <OFObject>
(Class) - class
 Returns the class of the object.
 
(nullable Class) - superclass
 Returns the superclass of the object.
 
(unsigned long) - hash
 Returns a hash for the object.
 
(unsigned int) - retainCount
 Returns the retain count.
 
(bool) - isProxy
 Returns whether the object is a proxy object.
 
(bool) - isKindOfClass:
 Returns a boolean whether the object is of the specified kind.
 
(bool) - isMemberOfClass:
 Returns a boolean whether the object is a member of the specified class.
 
(bool) - respondsToSelector:
 Returns a boolean whether the object responds to the specified selector.
 
(bool) - conformsToProtocol:
 Checks whether the object conforms to the specified protocol.
 
(nullable IMP- methodForSelector:
 Returns the implementation for the specified selector.
 
(nullable id) - performSelector:
 Performs the specified selector.
 
(nullable id) - performSelector:withObject:
 Performs the specified selector with the specified object.
 
(nullable id) - performSelector:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(nullable id) - performSelector:withObject:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(nullable id) - performSelector:withObject:withObject:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(bool) - isEqual:
 Checks two objects for equality.
 
(instancetype) - retain
 Increases the retain count.
 
(void) - release
 Decreases the retain count.
 
(instancetype) - autorelease
 Adds the object to the topmost autorelease pool of the thread's autorelease pool stack.
 
(instancetype) - self
 Returns the receiver.
 
(bool) - allowsWeakReference
 Returns whether the object allows a weak reference.
 
(bool) - retainWeakReference
 Retain a weak reference to this object.
 

Detailed Description

A delegate for OFStream.

Method Documentation

◆ stream:didReadIntoBuffer:length:exception:

- (bool) stream: (OFStream *) stream
didReadIntoBuffer: (void *) buffer
length: (size_t) length
exception: (nullable id) exception 
optional

This method is called when data was read asynchronously from a stream.

Parameters
streamThe stream on which data was read
bufferA buffer with the data that has been read
lengthThe length of the data that has been read
exceptionAn exception that occurred while reading, or nil on success
Returns
A bool whether the read should be repeated

◆ stream:didReadLine:exception:

- (bool) stream: (OFStream *) stream
didReadLine: (nullable OFString *) line
exception: (nullable id) exception 
optionalrequired

This method is called when a line was read asynchronously from a stream.

Parameters
streamThe stream on which a line was read
lineThe line which has been read or nil when the end of stream occurred
exceptionAn exception that occurred while reading, or nil on success
Returns
A bool whether the read should be repeated

◆ stream:didReadString:exception:

- (bool) stream: (OFStream *) stream
didReadString: (nullable OFString *) string
exception: (nullable id) exception 
optionalrequired

This method is called when a string was read asynchronously from a stream.

Parameters
streamThe stream on which a string was read
stringThe string which has been read or nil when the end of stream occurred
exceptionAn exception that occurred while reading, or nil on success
Returns
A bool whether the read should be repeated

◆ stream:didWriteData:bytesWritten:exception:

- (nullable OFData *) stream: (OFStream *) stream
didWriteData: (OFData *) data
bytesWritten: (size_t) bytesWritten
exception: (nullable id) exception 
optionalrequired

This method is called when data was written asynchronously to a stream.

Parameters
streamThe stream to which data was written
dataThe data which was written to the stream
bytesWrittenThe number of bytes which have been written. This matches the length of the specified data on the asynchronous write if no exception was encountered.
exceptionAn exception that occurred while writing, or nil on success
Returns
The data to repeat the write with or nil if it should not repeat

◆ stream:didWriteString:encoding:bytesWritten:exception:

- (nullable OFString *) stream: (OFStream *) stream
didWriteString: (OFString *) string
encoding: (OFStringEncoding) encoding
bytesWritten: (size_t) bytesWritten
exception: (nullable id) exception 
optionalrequired

This method is called when a string was written asynchronously to a stream.

Parameters
streamThe stream to which a string was written
stringThe string which was written to the stream
encodingThe encoding in which the string was written
bytesWrittenThe number of bytes which have been written. This matches the length of the specified data on the asynchronous write if no exception was encountered.
exceptionAn exception that occurred while writing, or nil on success
Returns
The string to repeat the write with or nil if it should not repeat

The documentation for this protocol was generated from the following file: