mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-13 04:51:03 +00:00
Automatically close forked beacon connections, fix connection forwards
This commit is contained in:
@@ -18,7 +18,6 @@ public interface RawReadConnection extends DataSourceReadConnection {
|
||||
|
||||
default void forward(DataSourceConnection con) throws Exception {
|
||||
try (var tCon = (RawWriteConnection) con) {
|
||||
tCon.init();
|
||||
byte[] b;
|
||||
while ((b = readBytes(BUFFER_SIZE)).length > 0) {
|
||||
tCon.write(b);
|
||||
|
||||
@@ -11,7 +11,6 @@ public interface StructureReadConnection extends DataSourceReadConnection {
|
||||
|
||||
default void forward(DataSourceConnection con) throws Exception {
|
||||
try (var tCon = (StructureWriteConnection) con) {
|
||||
tCon.init();
|
||||
tCon.write(read());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ public interface TextReadConnection extends DataSourceReadConnection {
|
||||
|
||||
default void forward(DataSourceConnection con) throws Exception {
|
||||
try (var tCon = (TextWriteConnection) con) {
|
||||
tCon.init();
|
||||
for (var it = lines().iterator(); it.hasNext(); ) {
|
||||
tCon.writeLine(it.next());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user