mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Massive refactoring to merge handling of simplex and duplex connections.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package org.briarproject.messaging;
|
||||
|
||||
import static org.briarproject.api.transport.TransportConstants.MAX_FRAME_LENGTH;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.briarproject.api.plugins.TransportConnectionReader;
|
||||
|
||||
class TestTransportConnectionReader implements TransportConnectionReader {
|
||||
|
||||
private final InputStream in;
|
||||
|
||||
private boolean disposed = false;
|
||||
|
||||
TestTransportConnectionReader(InputStream in) {
|
||||
this.in = in;
|
||||
}
|
||||
|
||||
public int getMaxFrameLength() {
|
||||
return MAX_FRAME_LENGTH;
|
||||
}
|
||||
|
||||
public long getMaxLatency() {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() {
|
||||
return in;
|
||||
}
|
||||
|
||||
public void dispose(boolean exception, boolean recognised) {
|
||||
assert !disposed;
|
||||
disposed = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user