Name

poll

Description

The poll command instructs the relay server to respond with a JXTA message destined for the client. If there is not a pending message for the client, the relay server should respond immediately.

Request

The following query string variable must be set by the client:

leaseId

Must be set to the lease ID of the lease

Response

If no message is queued for the client within this time, a response with a Content-Length of 0 will be sent. Otherwise, exactly one JXTA message will be sent in the response body. The Content-Length must be set to the length of the JXTA message. The Content-Type must be set to application/octet-stream. If the lease ID is not valid (e.g., the lease is expired), the response must be 400.

Example

The following listing shows an example HTTP POST request body for the poll command:

command=poll&leaseId=1234

Get JXTA in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.