aos/network: client to abort connection with no data

One problem we have seen is that the server appears to
successfully receive and process a connect message,
but never sends data. Because the server never sends
data, the client keeps sending the connect message at
kReconnectTimeout (3) second intervals. But the SCTP
state never changes.

If we can reasonably expect that there should be data
within 3 seconds and that failing to receive data also
means the connection has failed in some way, force SCTP
to start over by sending an abort. This results in an
SCTP_ASSOC_CHANGE(COMMUNICATION_LOST) notification
regardless of the state of the other side of the
connection, which will call NodeDisconnected and mark
the connection as down.

This is not guaranteed to fix the issues we were seeing,
but hopefully avoids the SCTP connection getting stuck
in a buggy state.

It may incidentally also force a reconnect faster when
an ethernet cable is disconnected and reconnected.

Change-Id: I6fdd0eed9bbe6a694152363ade48706b057cba6d
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/network/sctp_lib.h b/aos/network/sctp_lib.h
index e81e6b3..6cd11a3 100644
--- a/aos/network/sctp_lib.h
+++ b/aos/network/sctp_lib.h
@@ -100,6 +100,9 @@
   // Returns nullptr if the kernel blocks before returning a complete message.
   aos::unique_c_ptr<Message> ReadMessage();
 
+  // Send an abort message for the given association.
+  bool Abort(sctp_assoc_t snd_assoc_id);
+
   int fd() const { return fd_; }
 
   void SetMaxSize(size_t max_size) {