Jonathan Hart

Use isConnected rather than isWriteable to detemine if we can send to switch

Fixes ONOS-2426.

Change-Id: I1ccb6a599098a445b198f95a6223cef5671fd2e1
......@@ -96,14 +96,14 @@ public abstract class AbstractOpenFlowSwitch extends AbstractHandlerBehaviour
@Override
public final void sendMsg(OFMessage m) {
if (role == RoleState.MASTER && channel.isWritable()) {
if (role == RoleState.MASTER && channel.isConnected()) {
channel.write(Collections.singletonList(m));
}
}
@Override
public final void sendMsg(List<OFMessage> msgs) {
if (role == RoleState.MASTER && channel.isWritable()) {
if (role == RoleState.MASTER && channel.isConnected()) {
channel.write(msgs);
}
}
......