Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sodabrew committed Apr 24, 2018
1 parent 8d645e1 commit 6d770f5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions java/src/com/rubyeventmachine/EmReactor.java
Expand Up @@ -539,15 +539,15 @@ public Object[] getPeerName (long sig) {
}

public Object[] getSockName (long sig) {
EventableChannel channel = Connections.get(sig);
if (channel != null) {
return Connections.get(sig).getSockName();
}
else {
ServerSocketChannel acceptor = Acceptors.get(sig);
return new Object[] { acceptor.socket().getLocalPort(),
acceptor.socket().getInetAddress().getHostAddress() };
}
EventableChannel channel = Connections.get(sig);
if (channel != null) {
return Connections.get(sig).getSockName();
}
else {
ServerSocketChannel acceptor = Acceptors.get(sig);
return new Object[] { acceptor.socket().getLocalPort(),
acceptor.socket().getInetAddress().getHostAddress() };
}
}

public long attachChannel (SocketChannel sc, boolean watch_mode) {
Expand Down
8 changes: 4 additions & 4 deletions java/src/com/rubyeventmachine/EventableDatagramChannel.java
Expand Up @@ -70,23 +70,23 @@ public EventableDatagramChannel (DatagramChannel dc, long _binding, Selector sel
}

public void scheduleOutboundData (ByteBuffer bb) {
try {
try {
if ((!bCloseScheduled) && (bb.remaining() > 0)) {
outboundQ.addLast(new Packet(bb, returnAddress));
outboundS += bb.remaining();
channel.register(selector, SelectionKey.OP_WRITE | SelectionKey.OP_READ, this);
channel.register(selector, SelectionKey.OP_WRITE | SelectionKey.OP_READ, this);
}
} catch (ClosedChannelException e) {
throw new RuntimeException ("no outbound data");
}
}

public void scheduleOutboundDatagram (ByteBuffer bb, String recipAddress, int recipPort) {
try {
try {
if ((!bCloseScheduled) && (bb.remaining() > 0)) {
outboundQ.addLast(new Packet (bb, new InetSocketAddress (recipAddress, recipPort)));
outboundS += bb.remaining();
channel.register(selector, SelectionKey.OP_WRITE | SelectionKey.OP_READ, this);
channel.register(selector, SelectionKey.OP_WRITE | SelectionKey.OP_READ, this);
}
} catch (ClosedChannelException e) {
throw new RuntimeException ("no outbound data");
Expand Down
2 changes: 1 addition & 1 deletion java/src/com/rubyeventmachine/EventableSocketChannel.java
Expand Up @@ -242,7 +242,7 @@ public boolean writeOutboundData() throws IOException {
// If anyone wants to close immediately, they're responsible for clearing
// the outbound queue.
return (bCloseScheduled && outboundQ.isEmpty()) ? false : true;
}
}

public void setConnectPending() {
bConnectPending = true;
Expand Down

0 comments on commit 6d770f5

Please sign in to comment.