Protocols
The following protocols are available globally.
-
The Socket protocol provides an interface for a network socket, which is an endpoint in network communication.
The user can communicate through the streams provided by the socket. Incoming data can be retrieved through the input stream and data can be written to the network with the output stream.
See moreDeclaration
Swift
public protocol Socket : class
-
Delegate for a server socket.
The delegate of a server socket will receive notifications about new connections or errors.
See moreDeclaration
Swift
public protocol ServerSocketDelegate
-
Output stream for writing to an underlying target.
Implementation notes:
Only the function
See morewrite(data: UnsafePointer<Void>, lengthInBytes byteCount: Int) throws
should be implemented. Otherwrite
/writeln
functions should not be implemented as they are already implemented as an extension which will call thewrite(data: UnsafePointer<Void>, lengthInBytes byteCount: Int) throws
function.Declaration
Swift
public protocol OutputStream
-
Protocol for stream-serialization of objects.
A type implementing this protocol can write itself into an OutputStream.
If an object should also be stream-deserializable, it must implement the StreamReadable-protocol.
See moreDeclaration
Swift
public protocol StreamWritable
-
Delegate for event reporting of an input stream.
Reports, if new data is available or if the stream was closed.
See moreDeclaration
Swift
public protocol InputStreamDelegate
-
Input stream for reading from an underlying source.
Implementation notes:
The delegate should be notified, when new data comes available or the stream is closed.
If the stream implementation relies on an underlying stream, the delegate of the underlying stream should be set to this stream.
The delegate of this stream implementation should then be notified about delegate notifications from the underlying stream.
See moreDeclaration
Swift
public protocol InputStream : class
-
Protocol for a class which supports writing to a stream for custom network protocols.
See moreDeclaration
Swift
public protocol StreamReadable