commit | 9f1600aa53c483b600671bd0c572b5c1f5158626 | [log] [tgz] |
---|---|---|
author | Jonathan Hart <jono@onlab.us> | Tue Jul 28 13:58:31 2015 -0700 |
committer | Jonathan Hart <jono@onlab.us> | Wed Jul 29 09:26:46 2015 -0700 |
tree | 548402cc72689cd8d5f0e133418a40054a1f6059 | |
parent | 45066bc6f9a10ecdd2f49978fd2d7f1f12174cdf [diff] |
Use isConnected rather than isWriteable to detemine if we can send to switch Fixes ONOS-2479. Change-Id: I1ccb6a599098a445b198f95a6223cef5671fd2e1
diff --git a/openflow/api/src/main/java/org/onosproject/openflow/controller/driver/AbstractOpenFlowSwitch.java b/openflow/api/src/main/java/org/onosproject/openflow/controller/driver/AbstractOpenFlowSwitch.java index 294cd3f..8ac1e22 100644 --- a/openflow/api/src/main/java/org/onosproject/openflow/controller/driver/AbstractOpenFlowSwitch.java +++ b/openflow/api/src/main/java/org/onosproject/openflow/controller/driver/AbstractOpenFlowSwitch.java
@@ -96,14 +96,14 @@ @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); } }