@@ -22,6 +22,7 @@ struct IPC_EXPORT chan_impl {
2222 static ipc::handle_t inited ();
2323
2424 static bool connect (ipc::handle_t * ph, char const * name, unsigned mode);
25+ static bool connect (ipc::handle_t * ph, prefix, char const * name, unsigned mode);
2526 static bool reconnect (ipc::handle_t * ph, unsigned mode);
2627 static void disconnect (ipc::handle_t h);
2728 static void destroy (ipc::handle_t h);
@@ -54,6 +55,10 @@ class chan_wrapper {
5455 : connected_{this ->connect (name, mode)} {
5556 }
5657
58+ chan_wrapper (prefix pref, char const * name, unsigned mode = ipc::sender)
59+ : connected_{this ->connect (pref, name, mode)} {
60+ }
61+
5762 chan_wrapper (chan_wrapper&& rhs) noexcept
5863 : chan_wrapper{} {
5964 swap (rhs);
@@ -102,6 +107,11 @@ class chan_wrapper {
102107 detail_t::disconnect (h_); // clear old connection
103108 return connected_ = detail_t::connect (&h_, name, mode_ = mode);
104109 }
110+ bool connect (prefix pref, char const * name, unsigned mode = ipc::sender | ipc::receiver) {
111+ if (name == nullptr || name[0 ] == ' \0 ' ) return false ;
112+ detail_t::disconnect (h_); // clear old connection
113+ return connected_ = detail_t::connect (&h_, pref, name, mode_ = mode);
114+ }
105115
106116 /* *
107117 * Try connecting with new mode flags.
0 commit comments