proxy progress
This commit is contained in:
parent
a55715f369
commit
23d3f7b932
|
@ -187,7 +187,7 @@ public class LinkManager {
|
|||
int portPart = TcpConnector.getTcpPort(port);
|
||||
String hostname = TcpConnector.getHostname(port);
|
||||
socket = new Socket(hostname, portPart);
|
||||
return new TcpIoStream(logger, LinkManager.this, socket);
|
||||
return new TcpIoStream(logger, socket);
|
||||
} catch (Throwable e) {
|
||||
stateListener.onConnectionFailed();
|
||||
return null;
|
||||
|
|
|
@ -109,7 +109,7 @@ public class BinaryProtocolServer implements BinaryProtocolCommands {
|
|||
byte command = (byte) dis.read();
|
||||
System.out.println("Got [" + (char) command + "/" + command + "] command");
|
||||
|
||||
TcpIoStream stream = new TcpIoStream(logger, linkManager, clientSocket);
|
||||
TcpIoStream stream = new TcpIoStream(logger, clientSocket);
|
||||
if (command == COMMAND_HELLO) {
|
||||
stream.sendPacket((TS_OK + Fields.TS_SIGNATURE).getBytes(), logger);
|
||||
} else if (command == COMMAND_PROTOCOL) {
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.opensr5.Logger;
|
|||
import com.opensr5.io.DataListener;
|
||||
import com.rusefi.io.ByteReader;
|
||||
import com.rusefi.io.IoStream;
|
||||
import com.rusefi.io.LinkManager;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -20,16 +19,14 @@ public class TcpIoStream implements IoStream {
|
|||
private final InputStream input;
|
||||
private final OutputStream output;
|
||||
private final Logger logger;
|
||||
private final LinkManager linkManager;
|
||||
private boolean isClosed;
|
||||
|
||||
public TcpIoStream(Logger logger, LinkManager linkManager, Socket socket) throws IOException {
|
||||
this(logger, linkManager, new BufferedInputStream(socket.getInputStream()), socket.getOutputStream());
|
||||
public TcpIoStream(Logger logger, Socket socket) throws IOException {
|
||||
this(logger, new BufferedInputStream(socket.getInputStream()), socket.getOutputStream());
|
||||
}
|
||||
|
||||
private TcpIoStream(Logger logger, LinkManager linkManager, InputStream input, OutputStream output) {
|
||||
private TcpIoStream(Logger logger, InputStream input, OutputStream output) {
|
||||
this.logger = logger;
|
||||
this.linkManager = linkManager;
|
||||
if (input == null)
|
||||
throw new NullPointerException("input");
|
||||
if (output == null)
|
||||
|
|
Loading…
Reference in New Issue