Interface Network
- All Known Implementing Classes:
StandardNetwork
,TeaNetwork
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 will return a
Subscribable
that
applications can use to await the result. Callback methods will be invoked
from a thread that is compatible with the current renderer.-
Method Summary
Modifier and TypeMethodDescriptionnl.colorize.util.Subscribable
<nl.colorize.util.http.URLResponse> boolean
Returns true if this renderer supports peer-to-peer connectios on the current platform.nl.colorize.util.Subscribable
<PeerConnection> Opens a peer-to-peer connection.nl.colorize.util.Subscribable
<nl.colorize.util.http.URLResponse>
-
Method Details
-
get
nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse> get(String url, nl.colorize.util.http.Headers headers) -
post
nl.colorize.util.Subscribable<nl.colorize.util.http.URLResponse> post(String url, nl.colorize.util.http.Headers headers, nl.colorize.util.http.PostData body) -
openPeerConnection
nl.colorize.util.Subscribable<PeerConnection> openPeerConnection()Opens a peer-to-peer connection. The protocol used for the connection depends on both the renderer and the current platform. This also means that it is generally not possible to connect to peers on other platforms.- 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 connectios on the current platform. SeeopenPeerConnection()
.
-