ObjFW
 All Classes Functions Variables
Class Methods | List of all members
OFStreamSocket Class Reference

A class which provides functions to create and use stream sockets. More...

#import <OFStreamSocket.h>

Inheritance diagram for OFStreamSocket:
OFStream OFObject <OFCopying> <OFObject> OFTCPSocket

Class Methods

(instancetype) + socket
 Returns a new, autoreleased OFTCPSocket.
 

Additional Inherited Members

- Instance Methods inherited from OFStream
(BOOL) - isAtEndOfStream
 Returns a boolean whether the end of the stream has been reached.
 
(size_t) - readIntoBuffer:length:
 Reads at most size bytes from the stream into a buffer.
 
(void) - readIntoBuffer:exactLength:
 Reads exactly the specified length bytes from the stream into a buffer.
 
(void) - asyncReadIntoBuffer:length:target:selector:
 Asyncronously reads at most size bytes from the stream into a buffer.
 
(void) - asyncReadIntoBuffer:exactLength:target:selector:
 Asyncronously reads exactly the specified length bytes from the stream into a buffer.
 
(uint8_t) - readInt8
 Reads a uint8_t from the stream.
 
(uint16_t) - readBigEndianInt16
 Reads a uint16_t from the stream which is encoded in big endian.
 
(uint32_t) - readBigEndianInt32
 Reads a uint32_t from the stream which is encoded in big endian.
 
(uint64_t) - readBigEndianInt64
 Reads a uint64_t from the stream which is encoded in big endian.
 
(float) - readBigEndianFloat
 Reads a float from the stream which is encoded in big endian.
 
(double) - readBigEndianDouble
 Reads a double from the stream which is encoded in big endian.
 
(size_t) - readBigEndianInt16sIntoBuffer:count:
 Reads the specified number of uint16_ts from the stream which are encoded in big endian.
 
(size_t) - readBigEndianInt32sIntoBuffer:count:
 Reads the specified number of uint32_ts from the stream which are encoded in big endian.
 
(size_t) - readBigEndianInt64sIntoBuffer:count:
 Reads the specified number of uint64_ts from the stream which are encoded in big endian.
 
(size_t) - readBigEndianFloatsIntoBuffer:count:
 Reads the specified number of floats from the stream which are encoded in big endian.
 
(size_t) - readBigEndianDoublesIntoBuffer:count:
 Reads the specified number of doubles from the stream which are encoded in big endian.
 
(uint16_t) - readLittleEndianInt16
 Reads a uint16_t from the stream which is encoded in little endian.
 
(uint32_t) - readLittleEndianInt32
 Reads a uint32_t from the stream which is encoded in little endian.
 
(uint64_t) - readLittleEndianInt64
 Reads a uint64_t from the stream which is encoded in little endian.
 
(float) - readLittleEndianFloat
 Reads a float from the stream which is encoded in little endian.
 
(double) - readLittleEndianDouble
 Reads a double from the stream which is encoded in little endian.
 
(size_t) - readLittleEndianInt16sIntoBuffer:count:
 Reads the specified number of uint16_ts from the stream which are encoded in little endian.
 
(size_t) - readLittleEndianInt32sIntoBuffer:count:
 Reads the specified number of uint32_ts from the stream which are encoded in little endian.
 
(size_t) - readLittleEndianInt64sIntoBuffer:count:
 Reads the specified number of uint64_ts from the stream which are encoded in little endian.
 
(size_t) - readLittleEndianFloatsIntoBuffer:count:
 Reads the specified number of floats from the stream which are encoded in little endian.
 
(size_t) - readLittleEndianDoublesIntoBuffer:count:
 Reads the specified number of doubles from the stream which are encoded in little endian.
 
(OFDataArray *) - readDataArrayWithSize:
 Reads the specified number of items with an item size of 1 from the stream and returns them in an OFDataArray.
 
(OFDataArray *) - readDataArrayWithItemSize:count:
 Reads the specified number of items with the specified item size from the stream and returns them in an OFDataArray.
 
(OFDataArray *) - readDataArrayTillEndOfStream
 Returns an OFDataArray with all the remaining data of the stream.
 
(OFString *) - readStringWithLength:
 Reads a string with the specified length from the stream.
 
(OFString *) - readStringWithLength:encoding:
 Reads a string with the specified encoding and length from the stream.
 
(OFString *) - readLine
 Reads until a newline, \0 or end of stream occurs.
 
(OFString *) - readLineWithEncoding:
 Reads with the specified encoding until a newline, \0 or end of stream occurs.
 
(void) - asyncReadLineWithTarget:selector:
 Asyncronously reads until a newline, \0, end of stream or an exception occurs.
 
(void) - asyncReadLineWithEncoding:target:selector:
 Asyncronously reads with the specified encoding until a newline, \0, end of stream or an exception occurs.
 
(OFString *) - tryReadLine
 Tries to read a line from the stream (see readLine) and returns nil if no complete line has been received yet.
 
(OFString *) - tryReadLineWithEncoding:
 Tries to read a line from the stream with the specified encoding (see readLineWithEncoding:) and returns nil if no complete line has been received yet.
 
(OFString *) - readTillDelimiter:
 Reads until the specified string or \0 is found or the end of stream occurs.
 
(OFString *) - readTillDelimiter:encoding:
 Reads until the specified string or \0 is found or the end of stream occurs.
 
(OFString *) - tryReadTillDelimiter:
 Tries to reads until the specified string or \0 is found or the end of stream (see readTillDelimiter:) and returns nil if not enough data has been received yet.
 
(OFString *) - tryReadTillDelimiter:encoding:
 Tries to read until the specified string or \0 is found or the end of stream occurs (see readTillDelimiterWithEncoding:) and returns nil if not enough data has been received yet.
 
(BOOL) - writeBufferEnabled
 Returns a boolen whether writes are buffered.
 
(void) - setWriteBufferEnabled:
 Enables or disables the write buffer.
 
(void) - flushWriteBuffer
 Writes everythig in the write buffer to the stream.
 
(void) - writeBuffer:length:
 Writes from a buffer into the stream.
 
(void) - writeInt8:
 Writes a uint8_t into the stream.
 
(void) - writeBigEndianInt16:
 Writes a uint16_t into the stream, encoded in big endian.
 
(void) - writeBigEndianInt32:
 Writes a uint32_t into the stream, encoded in big endian.
 
(void) - writeBigEndianInt64:
 Writes a uint64_t into the stream, encoded in big endian.
 
(void) - writeBigEndianFloat:
 Writes a float into the stream, encoded in big endian.
 
(void) - writeBigEndianDouble:
 Writes a double into the stream, encoded in big endian.
 
(size_t) - writeBigEndianInt16s:count:
 Writes the specified number of uint16_ts into the stream, encoded in big endian.
 
(size_t) - writeBigEndianInt32s:count:
 Writes the specified number of uint32_ts into the stream, encoded in big endian.
 
(size_t) - writeBigEndianInt64s:count:
 Writes the specified number of uint64_ts into the stream, encoded in big endian.
 
(size_t) - writeBigEndianFloats:count:
 Writes the specified number of floats into the stream, encoded in big endian.
 
(size_t) - writeBigEndianDoubles:count:
 Writes the specified number of doubles into the stream, encoded in big endian.
 
(void) - writeLittleEndianInt16:
 Writes a uint16_t into the stream, encoded in little endian.
 
(void) - writeLittleEndianInt32:
 Writes a uint32_t into the stream, encoded in little endian.
 
(void) - writeLittleEndianInt64:
 Writes a uint64_t into the stream, encoded in little endian.
 
(void) - writeLittleEndianFloat:
 Writes a float into the stream, encoded in little endian.
 
(void) - writeLittleEndianDouble:
 Writes a double into the stream, encoded in little endian.
 
(size_t) - writeLittleEndianInt16s:count:
 Writes the specified number of uint16_ts into the stream, encoded in little endian.
 
(size_t) - writeLittleEndianInt32s:count:
 Writes the specified number of uint32_ts into the stream, encoded in little endian.
 
(size_t) - writeLittleEndianInt64s:count:
 Writes the specified number of uint64_ts into the stream, encoded in little endian.
 
(size_t) - writeLittleEndianFloats:count:
 Writes the specified number of floats into the stream, encoded in little endian.
 
(size_t) - writeLittleEndianDoubles:count:
 Writes the specified number of doubles into the stream, encoded in little endian.
 
(size_t) - writeDataArray:
 Writes from an OFDataArray into the stream.
 
(size_t) - writeString:
 Writes a string into the stream, without the trailing zero.
 
(size_t) - writeLine:
 Writes a string into the stream with a trailing newline.
 
(size_t) - writeFormat:
 Writes a formatted string into the stream.
 
(size_t) - writeFormat:arguments:
 Writes a formatted string into the stream.
 
(size_t) - pendingBytes
 Returns the number of bytes still present in the internal read cache.
 
(BOOL) - isBlocking
 Returns whether the stream is in blocking mode.
 
(void) - setBlocking:
 Enables or disables non-blocking I/O.
 
(int) - fileDescriptorForReading
 Returns the file descriptor for the read end of the stream.
 
(int) - fileDescriptorForWriting
 Returns the file descriptor for the write end of the stream.
 
(void) - close
 Closes the stream.
 
(size_t) - lowlevelReadIntoBuffer:length:
 Performs a lowlevel read.
 
(void) - lowlevelWriteBuffer:length:
 Performs a lowlevel write.
 
(BOOL) - lowlevelIsAtEndOfStream
 Returns whether the lowlevel is at the end of the stream.
 

Detailed Description

A class which provides functions to create and use stream sockets.

Method Documentation

+ (instancetype) socket

Returns a new, autoreleased OFTCPSocket.

Returns
A new, autoreleased OFTCPSocket

The documentation for this class was generated from the following files: