Interface Network


public interface Network
Interface for the platform-specific mechanism for network access. HTTP requests are sent asynchronously to avoid blocking the application. These asynchronous operations return a EventQueue that can be used to subscribe to the response.

MultimediaLib cannot use the standard HTTP client in java.net.http, as this is not yet available on all platforms supported by MultimediaLib.

  • Method Details

    • send

      nl.colorize.util.EventQueue<Response> send(String method, String url, Map<String,String> headers, @Nullable String body)
    • get

      default nl.colorize.util.EventQueue<Response> get(String url, Map<String,String> headers)
    • get

      default nl.colorize.util.EventQueue<Response> get(String url)
    • post

      default nl.colorize.util.EventQueue<Response> post(String url, Map<String,String> headers, String body)
    • post

      default nl.colorize.util.EventQueue<Response> post(String url, Map<String,String> headers, nl.colorize.util.http.PostData body)
    • openPeerConnection

      PeerConnection openPeerConnection()
      Opens a peer-to-peer connection. The protocol used for the connection depends on both the renderer and the current platform.
      Throws:
      UnsupportedOperationException - if peer-to-peer connections are not supported by the current platform and/or renderer.
    • isPeerToPeerSupported

      boolean isPeerToPeerSupported()
      Returns true if this renderer supports peer-to-peer connections on the current platform. If this method returns false, trying to open peer-to-peer connections using openPeerConnection() will result in an exception.