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 ...@@ -96,14 +96,14 @@ public abstract class AbstractOpenFlowSwitch extends AbstractHandlerBehaviour
96 96
97 @Override 97 @Override
98 public final void sendMsg(OFMessage m) { 98 public final void sendMsg(OFMessage m) {
99 - if (role == RoleState.MASTER && channel.isWritable()) { 99 + if (role == RoleState.MASTER && channel.isConnected()) {
100 channel.write(Collections.singletonList(m)); 100 channel.write(Collections.singletonList(m));
101 } 101 }
102 } 102 }
103 103
104 @Override 104 @Override
105 public final void sendMsg(List<OFMessage> msgs) { 105 public final void sendMsg(List<OFMessage> msgs) {
106 - if (role == RoleState.MASTER && channel.isWritable()) { 106 + if (role == RoleState.MASTER && channel.isConnected()) {
107 channel.write(msgs); 107 channel.write(msgs);
108 } 108 }
109 } 109 }
......