Classes

The following classes are available globally.

  • This is the IP stack that receives and outputs IP packets.

    outputBlock and delegate should be set before any input. Then call receivedPacket(_:) when a new IP packet is read from the TUN interface.

    There is a timer running internally. When the device is going to sleep (which means the timer will not fire for some time), then the timer must be paused by calling suspendTimer() and resumed by resumeTimer() when the deivce wakes up.

    Note

    This class is NOT thread-safe.
    See more

    Declaration

    Swift

    public final class TSIPStack
  • The TCP socket class.

    Note

    Unless one of socketDidReset(_:), socketDidAbort(_:) or socketDidClose(_:) delegation methods is called, please do close()the socket actively and wait for socketDidClose(_:) before releasing it.

    Note

    This class is NOT thread-safe, make sure every method call is on the same dispatch queue as TSIPStack.
    See more

    Declaration

    Swift

    public final class TSTCPSocket