Type Method

current()

Returns an NSHost object representing the host the process is running on.

Declaration

class func current() -> Self

Return Value

NSHost object for the process’s host.

Discussion

This method executes synchronously. The execution time of this method can be highly variable, depending on the local network configuration, and may block for several seconds if the network is unreachable. To avoid blocking execution on the main thread, you should call this method in an Operation or Grand Central Dispatch block that executes asynchronously in the background.

See Also

Creating Hosts

init(address: String)

Returns the NSHost with the Internet address address.

init(name: String?)

Returns a host with a specific name.