|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public static interface PaymentChannelServer.ServerConnection
Implements the connection between this server and the client, providing an interface which allows messages to be sent to the client, requests for the connection to the client to be closed, and callbacks which occur when the channel is fully open or the client completes a payment.
| Method Summary | |
|---|---|
void |
channelOpen(Sha256Hash contractHash)
Triggered when the channel is opened and payments can begin |
void |
destroyConnection(PaymentChannelCloseException.CloseReason reason)
Requests that the connection to the client be closed |
void |
paymentIncrease(BigInteger by,
BigInteger to)
Called when the payment in this channel was successfully incremented by the client |
void |
sendToClient(Protos.TwoWayChannelMessage msg)
Requests that the given message be sent to the client. |
| Method Detail |
|---|
void sendToClient(Protos.TwoWayChannelMessage msg)
Requests that the given message be sent to the client. 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
PaymentChannelServer.connectionClosed() should be called immediately.
Called while holding a lock on the PaymentChannelServer object - be careful about reentrancy
void destroyConnection(PaymentChannelCloseException.CloseReason reason)
Requests that the connection to the client be closed
Called while holding a lock on the PaymentChannelServer object - be careful about reentrancy
reason - The reason for the closure, see the individual values for more details.
It is usually safe to ignore this value.void channelOpen(Sha256Hash contractHash)
Triggered when the channel is opened and payments can begin
Called while holding a lock on the PaymentChannelServer object - be careful about reentrancy
contractHash - A unique identifier which represents this channel (actually the hash of the multisig contract)
void paymentIncrease(BigInteger by,
BigInteger to)
Called when the payment in this channel was successfully incremented by the client
Called while holding a lock on the PaymentChannelServer object - be careful about reentrancy
by - The increase in total paymentto - The new total payment to us (not including fees which may be required to claim the payment)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||