Port

public struct Port: CustomStringConvertible, Hashable, ExpressibleByIntegerLiteral

Represents the port number of IP protocol.

  • Initialize a new instance with the port number in network byte order.

    Declaration

    Swift

    public init(portInNetworkOrder: UInt16)

    Parameters

    portInNetworkOrder

    The port number in network byte order.

    Return Value

    The initailized port.

  • Initialize a new instance with the port number.

    Declaration

    Swift

    public init(port: UInt16)

    Parameters

    port

    The port number.

    Return Value

    The initailized port.

  • Declaration

    Swift

    public init(integerLiteral value: Port.IntegerLiteralType)
  • Initialize a new instance with data in network byte order.

    Declaration

    Swift

    public init(bytesInNetworkOrder: UnsafeRawPointer)

    Parameters

    bytesInNetworkOrder

    The port data in network byte order.

    Return Value

    The initailized port.

  • Declaration

    Swift

    public var description: String
  • The port number.

    Declaration

    Swift

    public var value: UInt16
  • Undocumented

    Declaration

    Swift

    public struct Port: CustomStringConvertible, Hashable, ExpressibleByIntegerLiteral
  • The hash value of the port.

    Declaration

    Swift

    public var hashValue: Int
  • Run a block with the bytes of port in network order.

    Declaration

    Swift

    public mutating func withUnsafeBufferPointer<T>(_ block: (UnsafeRawBufferPointer) -> T) -> T

    Parameters

    block

    The block to run.

    Return Value

    The value the block returns.