NetSocket

open class NetSocket : NSObject
extension NetSocket: StreamDelegate

The NetSocket class creates a two-way connection between a client and a server. This class is wrapper for a InputStream and an OutputStream.

  • The default time to wait for TCP/IP Handshake done.

    Declaration

    Swift

    public static let defaultTimeout: Int
  • Undocumented

    Declaration

    Swift

    public static let defaultWindowSizeC: Int
  • Undocumented

    Declaration

    Swift

    open var inputBuffer: Data
  • The time to wait for TCP/IP Handshake done.

    Declaration

    Swift

    open var timeout: Int
  • This instance connected to server(true) or not(false).

    Declaration

    Swift

    open var connected: Bool
  • Undocumented

    Declaration

    Swift

    open var windowSizeC: Int
  • The statistics of total incoming bytes.

    Declaration

    Swift

    open var totalBytesIn: Atomic<Int64>
  • The instance’s quality of service for a Socket IO.

    Declaration

    Swift

    open var qualityOfService: DispatchQoS
  • The instance determine to use the secure-socket layer (SSL) security level.

    Declaration

    Swift

    open var securityLevel: StreamSocketSecurityLevel
  • The statistics of total outgoing bytes.

    Declaration

    Swift

    open private(set) var totalBytesOut: Atomic<Int64> { get }
  • The statistics of total outgoing queued bytes.

    Declaration

    Swift

    open private(set) var queueBytesOut: Atomic<Int64> { get }
  • Creates a two-way connection to a server.

    Declaration

    Swift

    public func connect(withName: String, port: Int)
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func doOutput(data: Data, locked: UnsafeMutablePointer<UInt32>? = nil) -> Int
  • Undocumented

    Declaration

    Swift

    open func close()
  • Undocumented

    Declaration

    Swift

    open func listen()

StreamDelegate

  • Undocumented

    Declaration

    Swift

    public func stream(_ aStream: Stream, handle eventCode: Stream.Event)