Interface IPaymentChannelClient.ClientConnection

Implements the connection between this client and the server, providing an interface which allows messages to be
sent to the server, requests for the connection to the server to be closed, and a callback which occurs when the
channel is fully open.

Method Detail

sendToServer

Requests that the given message be sent to the server. There are no blocking requirements for this method,
however the order of messages must be preserved.

If the send fails, no exception should be thrown, however
PaymentChannelClient.connectionClosed() should be called immediately. In the case of messages which
are a part of initialization, initialization will simply fail and the refund transaction will be broadcasted
when it unlocks (if necessary). In the case of a payment message, the payment will be lost however if the
channel is resumed it will begin again from the channel value after the failed payment.

destroyConnection

Requests that the connection to the server be closed. For stateless protocols, note that after this call,
no more messages should be received from the server and this object is no longer usable. A
PaymentChannelClient.connectionClosed() event should be generated immediately after this call.