Skip to content

Commit

Permalink
Set attached flag on all attached channels
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm1 committed Aug 7, 2009
1 parent 3ef0592 commit 8b311e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions java/src/com/rubyeventmachine/EmReactor.java
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ public long attachChannel (SocketChannel sc, boolean watch_mode) throws ClosedCh
} else {
ec = new EventableSocketChannel (sc, b, mySelector, SelectionKey.OP_READ);
}
ec.setAttached();

Connections.put (b, ec);
return b;
Expand Down
7 changes: 7 additions & 0 deletions java/src/com/rubyeventmachine/EventableSocketChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class EventableSocketChannel implements EventableChannel {
boolean bCloseScheduled;
boolean bConnectPending;
boolean bWatchOnly;
boolean bAttached;
boolean bNotifyReadable;
boolean bNotifyWritable;

Expand All @@ -70,6 +71,7 @@ public EventableSocketChannel (SocketChannel sc, long _binding, Selector sel, in
bCloseScheduled = false;
bConnectPending = false;
bWatchOnly = false;
bAttached = false;
bNotifyReadable = false;
bNotifyWritable = false;
outboundQ = new LinkedList<ByteBuffer>();
Expand Down Expand Up @@ -257,6 +259,11 @@ public void setWatchOnly() {
}
public boolean isWatchOnly() { return bWatchOnly; }

public void setAttached() {
bAttached = true;
}
public boolean isAttached() { return bAttached; }

public void setNotifyReadable (boolean mode) {
bNotifyReadable = mode;
updateEvents();
Expand Down

0 comments on commit 8b311e4

Please sign in to comment.