Skip to content

Commit

Permalink
Rename TunnelConnection to TunnelServer
Browse files Browse the repository at this point in the history
The class manages the server socket, listening for new clients. Thus,
the name "TunnelServer" is more precise.
  • Loading branch information
rom1v committed May 17, 2017
1 parent 8a6bba2 commit 8e58cfd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions relay/src/main/java/com/genymobile/relay/Relay.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void start() throws IOException {
Selector selector = Selector.open();

// will register the socket on the selector
TunnelConnection tunnelConnection = new TunnelConnection(port, selector);
TunnelServer tunnelServer = new TunnelServer(port, selector);

SelectorAlarm selectorAlarm = new SelectorAlarm(selector);
selectorAlarm.start();
Expand All @@ -51,7 +51,7 @@ public void start() throws IOException {
Set<SelectionKey> selectedKeys = selector.selectedKeys();

if (selectorAlarm.accept()) {
tunnelConnection.cleanUp();
tunnelServer.cleanUp();
} else if (selectedKeys.isEmpty()) {
throw new AssertionError("selector.select() returned without any event, an invalid SelectionKey was probably been registered");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
/**
* Handle the connections from the clients.
*/
public class TunnelConnection {
public class TunnelServer {

private static final String TAG = TunnelConnection.class.getSimpleName();
private static final String TAG = TunnelServer.class.getSimpleName();

private final List<Client> clients = new ArrayList<>();

public TunnelConnection(int port, Selector selector) throws IOException {
public TunnelServer(int port, Selector selector) throws IOException {
ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
serverSocketChannel.configureBlocking(false);
// ServerSocketChannel.bind() requires API 24
Expand Down

0 comments on commit 8e58cfd

Please sign in to comment.