mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +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 {
|
class ProtoOutputStream {
|
||||||
private static final Logger log = LoggerFactory.getLogger(ProtoOutputStream.class);
|
private static final Logger log = LoggerFactory.getLogger(ProtoOutputStream.class);
|
||||||
|
|
||||||
private final OutputStream delegate;
|
private final OutputStream outputStream;
|
||||||
private final Statistic statistic;
|
private final Statistic statistic;
|
||||||
|
|
||||||
ProtoOutputStream(OutputStream delegate, Statistic statistic) {
|
ProtoOutputStream(OutputStream outputStream, Statistic statistic) {
|
||||||
this.delegate = delegate;
|
this.outputStream = outputStream;
|
||||||
this.statistic = statistic;
|
this.statistic = statistic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class ProtoOutputStream {
|
||||||
|
|
||||||
void onConnectionShutdown() {
|
void onConnectionShutdown() {
|
||||||
try {
|
try {
|
||||||
delegate.close();
|
outputStream.close();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.error("Failed to close connection", t);
|
log.error("Failed to close connection", t);
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,8 @@ class ProtoOutputStream {
|
||||||
private void writeEnvelopeOrThrow(NetworkEnvelope envelope) throws IOException {
|
private void writeEnvelopeOrThrow(NetworkEnvelope envelope) throws IOException {
|
||||||
long ts = System.currentTimeMillis();
|
long ts = System.currentTimeMillis();
|
||||||
protobuf.NetworkEnvelope proto = envelope.toProtoNetworkEnvelope();
|
protobuf.NetworkEnvelope proto = envelope.toProtoNetworkEnvelope();
|
||||||
proto.writeDelimitedTo(delegate);
|
proto.writeDelimitedTo(outputStream);
|
||||||
delegate.flush();
|
outputStream.flush();
|
||||||
long duration = System.currentTimeMillis() - ts;
|
long duration = System.currentTimeMillis() - ts;
|
||||||
if (duration > 10000) {
|
if (duration > 10000) {
|
||||||
log.info("Sending {} to peer took {} sec.", envelope.getClass().getSimpleName(), duration / 1000d);
|
log.info("Sending {} to peer took {} sec.", envelope.getClass().getSimpleName(), duration / 1000d);
|
||||||
|
|
Loading…
Add table
Reference in a new issue