Make sinit_max_init_timeo configurable in message_bridge_client

When connecting, the other client may not be alive yet.  We don't want
the exponential backoff to grow anywhere close to RTO.Max during normal
operations because that can cause high connection times.  Default to the
original behavior (pick up the OS's default), and let the user set
whatever they want.  This avoids breaking existing setups.

Change-Id: Idb33add72d8689b9800272577c98e9e4e99c1e51
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/network/sctp_client.cc b/aos/network/sctp_client.cc
index a2c0439..e3da03a 100644
--- a/aos/network/sctp_client.cc
+++ b/aos/network/sctp_client.cc
@@ -13,6 +13,10 @@
 #include "aos/unique_malloc_ptr.h"
 #include "glog/logging.h"
 
+DEFINE_int32(sinit_max_init_timeout, 0,
+             "Timeout in milliseconds for retrying the INIT packet when "
+             "connecting to the message bridge server");
+
 namespace aos {
 namespace message_bridge {
 
@@ -29,6 +33,8 @@
     memset(&initmsg, 0, sizeof(struct sctp_initmsg));
     initmsg.sinit_num_ostreams = streams;
     initmsg.sinit_max_instreams = streams;
+    // Max timeout in milliseconds for the INIT packet.
+    initmsg.sinit_max_init_timeo = FLAGS_sinit_max_init_timeout;
     PCHECK(setsockopt(fd(), IPPROTO_SCTP, SCTP_INITMSG, &initmsg,
                       sizeof(struct sctp_initmsg)) == 0);
   }