Class NostrRTCSocket

java.lang.Object
org.ngengine.nostr4j.rtc.NostrRTCSocket

public final class NostrRTCSocket extends Object
An RTC socket between two peers. This class will try to establish a direct connection between the two peers, when not possible it will fallback to a TURN server. Note: isRTCConnected() reports RTC transport connectivity only. TURN failover is internal and surfaced through listeners transport switch events. This is because, to avoid inefficiencies, the keep-alive mechanism is implemented only in the signaling protocol: when the signaling announce is stale, the socket should be closed using close(). So keep in mind that you need to handle keep-alive youself, if you want to use this class by itself (without the signaling protocol).
  • Field Details

  • Method Details

    • getLocalPeer

      public NostrRTCLocalPeer getLocalPeer()
      Get the local peer.
      Returns:
      The local peer.
    • getRemotePeer

      public NostrRTCPeer getRemotePeer()
      Get the remote peer if connected, otherwise null.
      Returns:
      The remote peer or null.
    • isClosed

      public boolean isClosed()