Skip to content

Commit dbbd64b

Browse files
committed
[socket.basic], [socket.acceptor] Add release member functions
Fixes NB GB-15 (PDTS)
1 parent 5fa23c4 commit dbbd64b

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

src/sockets.tex

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
\rSec2[socket.reqmts.native]{Native handles}
201201

202202
\pnum
203-
Several classes described in this Technical Specification have a member type \tcode{native_handle_type}, a member function \tcode{native_handle}, and member functions that accept arguments of type \tcode{native_handle_type}. The presence of these members and their semantics is
203+
Several classes described in this Technical Specification have a member type \tcode{native_handle_type}, a member function \tcode{native_handle}, and member functions that return or accept arguments of type \tcode{native_handle_type}. The presence of these members and their semantics is
204204
\impldef{presence and meaning of \tcode{native_handle_type} and \tcode{native_handle}}.
205205

206206
\pnum
@@ -1460,6 +1460,9 @@
14601460
const native_handle_type& native_socket,
14611461
error_code& ec); // \nativeref
14621462

1463+
native_handle_type release(); // \nativeref
1464+
native_handle_type release(error_code& ec); // \nativeref
1465+
14631466
bool is_open() const noexcept;
14641467

14651468
void close();
@@ -1871,6 +1874,31 @@
18711874
\end{itemize}
18721875
\end{itemdescr}
18731876

1877+
\begin{itemdecl}
1878+
native_handle_type release();
1879+
native_handle_type release(error_code& ec);
1880+
\end{itemdecl}
1881+
1882+
\begin{itemdescr}
1883+
\pnum
1884+
\requires \tcode{is_open() == true}.
1885+
1886+
\pnum
1887+
\effects Cancels all outstanding asynchronous operations associated with this socket.
1888+
Completion handlers for canceled asynchronous operations are passed an error code \tcode{ec}
1889+
such that \tcode{ec == errc::operation_canceled} yields \tcode{true}.
1890+
1891+
\pnum
1892+
\returns The native representation of this socket.
1893+
1894+
\pnum
1895+
\postconditions \tcode{is_open() == false}.
1896+
1897+
\pnum
1898+
\remarks Since the native socket is not closed prior to returning it,
1899+
the caller is responsible for closing it.
1900+
\end{itemdescr}
1901+
18741902
\begin{itemdecl}
18751903
bool is_open() const noexcept;
18761904
\end{itemdecl}
@@ -3397,6 +3425,9 @@
33973425
const native_handle_type& native_acceptor,
33983426
error_code& ec); // \nativeref
33993427

3428+
native_handle_type release(); // \nativeref
3429+
native_handle_type release(error_code& ec); // \nativeref
3430+
34003431
bool is_open() const;
34013432

34023433
void close();
@@ -3827,6 +3858,31 @@
38273858
\end{itemize}
38283859
\end{itemdescr}
38293860

3861+
\begin{itemdecl}
3862+
native_handle_type release();
3863+
native_handle_type release(error_code& ec);
3864+
\end{itemdecl}
3865+
3866+
\begin{itemdescr}
3867+
\pnum
3868+
\requires \tcode{is_open() == true}.
3869+
3870+
\pnum
3871+
\effects Cancels all outstanding asynchronous operations associated with this acceptor.
3872+
Completion handlers for canceled asynchronous operations are passed an error code \tcode{ec}
3873+
such that \tcode{ec == errc::operation_canceled} yields \tcode{true}.
3874+
3875+
\pnum
3876+
\returns The native representation of this acceptor.
3877+
3878+
\pnum
3879+
\postconditions \tcode{is_open() == false}.
3880+
3881+
\pnum
3882+
\remarks Since the native acceptor is not closed prior to returning it,
3883+
the caller is responsible for closing it.
3884+
\end{itemdescr}
3885+
38303886
\begin{itemdecl}
38313887
bool is_open() const;
38323888
\end{itemdecl}

0 commit comments

Comments
 (0)