getStreamsTo(_:port:inputStream:outputStream:)
Creates and returns by reference an NSInputStream object and NSOutputStream object for a socket connection with a given host on a given port.
Declaration
class func getStreamsTo(_ host: Host, port: Int, inputStream: AutoreleasingUnsafeMutablePointer<InputStream?>?, outputStream: AutoreleasingUnsafeMutablePointer<OutputStream?>?)Parameters
- host:
The host to which to connect.
- port:
The port to connect to on
host. - inputStream:
Upon return, contains the input stream. If
nilis passed, the stream object is not created. - outputStream:
Upon return, contains the output stream. If
nilis passed, the stream object is not created.
Discussion
If neither port nor host is properly specified, no socket connection is made.