diff options
author | Determinant <ted.sybil@gmail.com> | 2018-11-14 23:21:55 -0500 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2018-11-14 23:21:55 -0500 |
commit | 389a9a56e00225b0e682d64cb05e5291c23892b0 (patch) | |
tree | 3bc94d28fdb4183d7d7747fd425c4c53722001fd /README.rst | |
parent | 5f88ebb43acc7b7fa3ac272a444677dd72ccb63d (diff) |
add libuv cmake script
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -67,7 +67,6 @@ Example (MsgNetwork layer) -------------------------- .. code-block:: cpp - #include <cstdio> #include <string> #include <functional> @@ -135,8 +134,8 @@ Example (MsgNetwork layer) reg_handler(salticidae::generic_bind( &MyNet::on_receive_hello, this, _1, _2)); - reg_conn_handler([this](ConnPool::Conn &conn) { - if (conn.get_fd() != -1) + reg_conn_handler([this](ConnPool::Conn &conn, bool connected) { + if (connected) { if (conn.get_mode() == ConnPool::Conn::ACTIVE) { @@ -175,8 +174,8 @@ Example (MsgNetwork layer) } salticidae::EventContext ec; - NetAddr alice_addr("127.0.0.1:1234"); - NetAddr bob_addr("127.0.0.1:1235"); + NetAddr alice_addr("127.0.0.1:12345"); + NetAddr bob_addr("127.0.0.1:12346"); int main() { /* test two nodes */ @@ -187,6 +186,9 @@ Example (MsgNetwork layer) alice.reg_handler(on_receive_ack); bob.reg_handler(on_receive_ack); + alice.start(); + bob.start(); + alice.listen(alice_addr); bob.listen(bob_addr); |