lipp/lua-jet — pull request #15 by lipp (2013-11-01 23:17:54+00:00)
Title: Resumable connection

Makes connections fully resumable after connection loss.

A Peer can mark itself 'persistent' by calling 'config' method with params

```JSON
{
"method": "config",
"params": {
"persist": true,
"time": 60 // optional time for which all messages are stored/cached if connection is lost
},
"id": 28382 // id is required, since the response is relevant to continue
}
```

The Daemon returns a unique resume id (String).
Given this resume id and the message count of the messages completely received and processed by the Peer, the Peer can resume the session. The Daemon eventually resends messages which have been missed.

```JSON
{
"method": "config",
"params": {
"resume": {
"id": "asdjhs82",
"receivedCount": 72 // The number of completely received and processed messages
} ,
"time": 60 // optional time for which all messages are stored/cached if connection is lost
},
"id": 28382 // id is required, since the response is relevant to continue
}
```