.. _program_listing_file_src_o3ds_pair.cpp: Program Listing for File pair.cpp ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/o3ds/pair.cpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #include "pair.h" namespace O3DS { bool ClientPair::start(const char* url) { int ret; ret = nng_pair1_open(&mSocket); if (ret != 0) { setError("Could not create pair socket for dial", ret); return false; } ret = nng_dial(mSocket, url, NULL, 0); if (ret != 0) { setError("Could not dial using pair", ret); return false; } return true; } bool ServerPair::start(const char *url) { int ret; ret = nng_pair1_open(&mSocket); if (ret != 0) { setError("Could not create pair socket for listen", ret); return false; } ret = nng_listen(mSocket, url, NULL, 0); if(ret != 0) { setError("Could not listen on pair connection", ret); return false; } return true; } }