mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 15:00:30 +01:00
Rename delegate to outputStream
Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
parent
86723cf85a
commit
96ea154176
1 changed files with 6 additions and 6 deletions
|
@ -33,11 +33,11 @@ import javax.annotation.concurrent.NotThreadSafe;
|
|||
class ProtoOutputStream {
|
||||
private static final Logger log = LoggerFactory.getLogger(ProtoOutputStream.class);
|
||||
|
||||
private final OutputStream delegate;
|
||||
private final OutputStream outputStream;
|
||||
private final Statistic statistic;
|
||||
|
||||
ProtoOutputStream(OutputStream delegate, Statistic statistic) {
|
||||
this.delegate = delegate;
|
||||
ProtoOutputStream(OutputStream outputStream, Statistic statistic) {
|
||||
this.outputStream = outputStream;
|
||||
this.statistic = statistic;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ class ProtoOutputStream {
|
|||
|
||||
void onConnectionShutdown() {
|
||||
try {
|
||||
delegate.close();
|
||||
outputStream.close();
|
||||
} catch (Throwable t) {
|
||||
log.error("Failed to close connection", t);
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ class ProtoOutputStream {
|
|||
private void writeEnvelopeOrThrow(NetworkEnvelope envelope) throws IOException {
|
||||
long ts = System.currentTimeMillis();
|
||||
protobuf.NetworkEnvelope proto = envelope.toProtoNetworkEnvelope();
|
||||
proto.writeDelimitedTo(delegate);
|
||||
delegate.flush();
|
||||
proto.writeDelimitedTo(outputStream);
|
||||
outputStream.flush();
|
||||
long duration = System.currentTimeMillis() - ts;
|
||||
if (duration > 10000) {
|
||||
log.info("Sending {} to peer took {} sec.", envelope.getClass().getSimpleName(), duration / 1000d);
|
||||
|
|
Loading…
Add table
Reference in a new issue