|
YAACC - UPNP Client and Server
|
The listening side of the client-initiated mode (spec, "Client Initiated Connections"): a client that finds this server by mDNS (_sendspin-server._tcp) opens a WebSocket to it and speaks first.
More...

Classes | |
| interface | Listener |
| Receives a connection whose WebSocket upgrade is done. More... | |
Public Member Functions | |
| InboundServer (int port, String path, Predicate< InetAddress > accept, Listener listener, int maxConnections, int timeoutMillis) | |
| void | setLocalPath (String secretPath) |
| A second path, with a secret in it, that is served over the loopback address only; a link that came by it is delivered as local. | |
| synchronized void | start () throws IOException |
| Binds the port and starts accepting. | |
| int | port () |
| The port that is bound (the real one when 0 was asked for), or -1 if the server is not running. | |
| boolean | isRunning () |
| synchronized void | close () |
| Stops accepting. | |
The listening side of the client-initiated mode (spec, "Client Initiated Connections"): a client that finds this server by mDNS (_sendspin-server._tcp) opens a WebSocket to it and speaks first.
Opt-in (the user's switch, off by default) and as small as it can be: only addresses the filter accepts are read at all, a request with an Origin header or for another path is refused, a client that does not finish its upgrade within the timeout is dropped, and at most maxConnections are held at once (a closed link makes room). The handshake and everything after it belong to the hub connection. Closing the server stops new connections only; established ones go on. Nothing is read from a connection before it passed the filter.
| de.yaacc.sendspin.hub.InboundServer.InboundServer | ( | int | port, |
| String | path, | ||
| Predicate< InetAddress > | accept, | ||
| Listener | listener, | ||
| int | maxConnections, | ||
| int | timeoutMillis ) |
| port | the port to listen on, 0 for any free one |
| path | the only request path that is served |
| accept | which remote addresses are read at all (the local network) |
| timeoutMillis | how long the upgrade of one client may take |

| synchronized void de.yaacc.sendspin.hub.InboundServer.close | ( | ) |
Stops accepting.
Connections that are established are not touched.
| void de.yaacc.sendspin.hub.InboundServer.setLocalPath | ( | String | secretPath | ) |
A second path, with a secret in it, that is served over the loopback address only; a link that came by it is delivered as local.
Any program on the phone can reach the loopback address, so the address alone proves nothing: the secret exists only in this process. Null: there is no such path.
| synchronized void de.yaacc.sendspin.hub.InboundServer.start | ( | ) | throws IOException |
Binds the port and starts accepting.
| IOException | if the port can not be bound |