-
diff -ur boost_1_36_0/boost/asio/basic_datagram_socket.hpp boost_1_36_0_exceptions/boost/asio/basic_datagram_socket.hpp
old
|
new
|
|
152 | 152 | * buffers in one go, and how to use it with arrays, boost::array or |
153 | 153 | * std::vector. |
154 | 154 | */ |
| 155 | #ifndef BOOST_NO_EXCEPTIONS |
155 | 156 | template <typename ConstBufferSequence> |
156 | 157 | std::size_t send(const ConstBufferSequence& buffers) |
157 | 158 | { |
… |
… |
|
160 | 161 | boost::asio::detail::throw_error(ec); |
161 | 162 | return s; |
162 | 163 | } |
| 164 | #endif |
163 | 165 | |
164 | 166 | /// Send some data on a connected socket. |
165 | 167 | /** |
… |
… |
|
178 | 180 | * @note The send operation can only be used with a connected socket. Use |
179 | 181 | * the send_to function to send data on an unconnected datagram socket. |
180 | 182 | */ |
| 183 | #ifndef BOOST_NO_EXCEPTIONS |
181 | 184 | template <typename ConstBufferSequence> |
182 | 185 | std::size_t send(const ConstBufferSequence& buffers, |
183 | 186 | socket_base::message_flags flags) |
… |
… |
|
188 | 191 | boost::asio::detail::throw_error(ec); |
189 | 192 | return s; |
190 | 193 | } |
| 194 | #endif |
191 | 195 | |
192 | 196 | /// Send some data on a connected socket. |
193 | 197 | /** |
… |
… |
|
316 | 320 | * buffers in one go, and how to use it with arrays, boost::array or |
317 | 321 | * std::vector. |
318 | 322 | */ |
| 323 | #ifndef BOOST_NO_EXCEPTIONS |
319 | 324 | template <typename ConstBufferSequence> |
320 | 325 | std::size_t send_to(const ConstBufferSequence& buffers, |
321 | 326 | const endpoint_type& destination) |
… |
… |
|
326 | 331 | boost::asio::detail::throw_error(ec); |
327 | 332 | return s; |
328 | 333 | } |
| 334 | #endif |
329 | 335 | |
330 | 336 | /// Send a datagram to the specified endpoint. |
331 | 337 | /** |
… |
… |
|
343 | 349 | * |
344 | 350 | * @throws boost::system::system_error Thrown on failure. |
345 | 351 | */ |
| 352 | #ifndef BOOST_NO_EXCEPTIONS |
346 | 353 | template <typename ConstBufferSequence> |
347 | 354 | std::size_t send_to(const ConstBufferSequence& buffers, |
348 | 355 | const endpoint_type& destination, socket_base::message_flags flags) |
… |
… |
|
353 | 360 | boost::asio::detail::throw_error(ec); |
354 | 361 | return s; |
355 | 362 | } |
| 363 | #endif |
356 | 364 | |
357 | 365 | /// Send a datagram to the specified endpoint. |
358 | 366 | /** |
… |
… |
|
484 | 492 | * multiple buffers in one go, and how to use it with arrays, boost::array or |
485 | 493 | * std::vector. |
486 | 494 | */ |
| 495 | #ifndef BOOST_NO_EXCEPTIONS |
487 | 496 | template <typename MutableBufferSequence> |
488 | 497 | std::size_t receive(const MutableBufferSequence& buffers) |
489 | 498 | { |
… |
… |
|
493 | 502 | boost::asio::detail::throw_error(ec); |
494 | 503 | return s; |
495 | 504 | } |
| 505 | #endif |
496 | 506 | |
497 | 507 | /// Receive some data on a connected socket. |
498 | 508 | /** |
… |
… |
|
512 | 522 | * the receive_from function to receive data on an unconnected datagram |
513 | 523 | * socket. |
514 | 524 | */ |
| 525 | #ifndef BOOST_NO_EXCEPTIONS |
515 | 526 | template <typename MutableBufferSequence> |
516 | 527 | std::size_t receive(const MutableBufferSequence& buffers, |
517 | 528 | socket_base::message_flags flags) |
… |
… |
|
522 | 533 | boost::asio::detail::throw_error(ec); |
523 | 534 | return s; |
524 | 535 | } |
| 536 | #endif |
525 | 537 | |
526 | 538 | /// Receive some data on a connected socket. |
527 | 539 | /** |
… |
… |
|
651 | 663 | * multiple buffers in one go, and how to use it with arrays, boost::array or |
652 | 664 | * std::vector. |
653 | 665 | */ |
| 666 | #ifndef BOOST_NO_EXCEPTIONS |
654 | 667 | template <typename MutableBufferSequence> |
655 | 668 | std::size_t receive_from(const MutableBufferSequence& buffers, |
656 | 669 | endpoint_type& sender_endpoint) |
… |
… |
|
661 | 674 | boost::asio::detail::throw_error(ec); |
662 | 675 | return s; |
663 | 676 | } |
| 677 | #endif |
664 | 678 | |
665 | 679 | /// Receive a datagram with the endpoint of the sender. |
666 | 680 | /** |
… |
… |
|
678 | 692 | * |
679 | 693 | * @throws boost::system::system_error Thrown on failure. |
680 | 694 | */ |
| 695 | #ifndef BOOST_NO_EXCEPTIONS |
681 | 696 | template <typename MutableBufferSequence> |
682 | 697 | std::size_t receive_from(const MutableBufferSequence& buffers, |
683 | 698 | endpoint_type& sender_endpoint, socket_base::message_flags flags) |
… |
… |
|
688 | 703 | boost::asio::detail::throw_error(ec); |
689 | 704 | return s; |
690 | 705 | } |
| 706 | #endif |
691 | 707 | |
692 | 708 | /// Receive a datagram with the endpoint of the sender. |
693 | 709 | /** |
-
diff -ur boost_1_36_0/boost/asio/basic_deadline_timer.hpp boost_1_36_0_exceptions/boost/asio/basic_deadline_timer.hpp
old
|
new
|
|
154 | 154 | * @param expiry_time The expiry time to be used for the timer, expressed |
155 | 155 | * as an absolute time. |
156 | 156 | */ |
| 157 | #ifndef BOOST_NO_EXCEPTIONS |
157 | 158 | basic_deadline_timer(boost::asio::io_service& io_service, |
158 | 159 | const time_type& expiry_time) |
159 | 160 | : basic_io_object<TimerService>(io_service) |
… |
… |
|
162 | 163 | this->service.expires_at(this->implementation, expiry_time, ec); |
163 | 164 | boost::asio::detail::throw_error(ec); |
164 | 165 | } |
| 166 | #endif |
165 | 167 | |
166 | 168 | /// Constructor to set a particular expiry time relative to now. |
167 | 169 | /** |
… |
… |
|
173 | 175 | * @param expiry_time The expiry time to be used for the timer, relative to |
174 | 176 | * now. |
175 | 177 | */ |
| 178 | #ifndef BOOST_NO_EXCEPTIONS |
176 | 179 | basic_deadline_timer(boost::asio::io_service& io_service, |
177 | 180 | const duration_type& expiry_time) |
178 | 181 | : basic_io_object<TimerService>(io_service) |
… |
… |
|
181 | 184 | this->service.expires_from_now(this->implementation, expiry_time, ec); |
182 | 185 | boost::asio::detail::throw_error(ec); |
183 | 186 | } |
| 187 | #endif |
184 | 188 | |
185 | 189 | /// Cancel any asynchronous operations that are waiting on the timer. |
186 | 190 | /** |
… |
… |
|
194 | 198 | * |
195 | 199 | * @throws boost::system::system_error Thrown on failure. |
196 | 200 | */ |
| 201 | #ifndef BOOST_NO_EXCEPTIONS |
197 | 202 | std::size_t cancel() |
198 | 203 | { |
199 | 204 | boost::system::error_code ec; |
… |
… |
|
201 | 206 | boost::asio::detail::throw_error(ec); |
202 | 207 | return s; |
203 | 208 | } |
| 209 | #endif |
204 | 210 | |
205 | 211 | /// Cancel any asynchronous operations that are waiting on the timer. |
206 | 212 | /** |
… |
… |
|
241 | 247 | * |
242 | 248 | * @throws boost::system::system_error Thrown on failure. |
243 | 249 | */ |
| 250 | #ifndef BOOST_NO_EXCEPTIONS |
244 | 251 | std::size_t expires_at(const time_type& expiry_time) |
245 | 252 | { |
246 | 253 | boost::system::error_code ec; |
… |
… |
|
249 | 256 | boost::asio::detail::throw_error(ec); |
250 | 257 | return s; |
251 | 258 | } |
| 259 | #endif |
252 | 260 | |
253 | 261 | /// Set the timer's expiry time as an absolute time. |
254 | 262 | /** |
… |
… |
|
290 | 298 | * |
291 | 299 | * @throws boost::system::system_error Thrown on failure. |
292 | 300 | */ |
| 301 | #ifndef BOOST_NO_EXCEPTIONS |
293 | 302 | std::size_t expires_from_now(const duration_type& expiry_time) |
294 | 303 | { |
295 | 304 | boost::system::error_code ec; |
… |
… |
|
298 | 307 | boost::asio::detail::throw_error(ec); |
299 | 308 | return s; |
300 | 309 | } |
| 310 | #endif |
301 | 311 | |
302 | 312 | /// Set the timer's expiry time relative to now. |
303 | 313 | /** |
… |
… |
|
325 | 335 | * |
326 | 336 | * @throws boost::system::system_error Thrown on failure. |
327 | 337 | */ |
| 338 | #ifndef BOOST_NO_EXCEPTIONS |
328 | 339 | void wait() |
329 | 340 | { |
330 | 341 | boost::system::error_code ec; |
331 | 342 | this->service.wait(this->implementation, ec); |
332 | 343 | boost::asio::detail::throw_error(ec); |
333 | 344 | } |
| 345 | #endif |
334 | 346 | |
335 | 347 | /// Perform a blocking wait on the timer. |
336 | 348 | /** |
-
diff -ur boost_1_36_0/boost/asio/basic_socket.hpp boost_1_36_0_exceptions/boost/asio/basic_socket.hpp
old
|
new
|
|
79 | 79 | * |
80 | 80 | * @throws boost::system::system_error Thrown on failure. |
81 | 81 | */ |
| 82 | #ifndef BOOST_NO_EXCEPTIONS |
82 | 83 | basic_socket(boost::asio::io_service& io_service, |
83 | 84 | const protocol_type& protocol) |
84 | 85 | : basic_io_object<SocketService>(io_service) |
… |
… |
|
87 | 88 | this->service.open(this->implementation, protocol, ec); |
88 | 89 | boost::asio::detail::throw_error(ec); |
89 | 90 | } |
| 91 | #endif |
90 | 92 | |
91 | 93 | /// Construct a basic_socket, opening it and binding it to the given local |
92 | 94 | /// endpoint. |
… |
… |
|
103 | 105 | * |
104 | 106 | * @throws boost::system::system_error Thrown on failure. |
105 | 107 | */ |
| 108 | #ifndef BOOST_NO_EXCEPTIONS |
106 | 109 | basic_socket(boost::asio::io_service& io_service, |
107 | 110 | const endpoint_type& endpoint) |
108 | 111 | : basic_io_object<SocketService>(io_service) |
… |
… |
|
113 | 116 | this->service.bind(this->implementation, endpoint, ec); |
114 | 117 | boost::asio::detail::throw_error(ec); |
115 | 118 | } |
| 119 | #endif |
116 | 120 | |
117 | 121 | /// Construct a basic_socket on an existing native socket. |
118 | 122 | /** |
… |
… |
|
127 | 131 | * |
128 | 132 | * @throws boost::system::system_error Thrown on failure. |
129 | 133 | */ |
| 134 | #ifndef BOOST_NO_EXCEPTIONS |
130 | 135 | basic_socket(boost::asio::io_service& io_service, |
131 | 136 | const protocol_type& protocol, const native_type& native_socket) |
132 | 137 | : basic_io_object<SocketService>(io_service) |
… |
… |
|
135 | 140 | this->service.assign(this->implementation, protocol, native_socket, ec); |
136 | 141 | boost::asio::detail::throw_error(ec); |
137 | 142 | } |
| 143 | #endif |
138 | 144 | |
139 | 145 | /// Get a reference to the lowest layer. |
140 | 146 | /** |
… |
… |
|
164 | 170 | * socket.open(boost::asio::ip::tcp::v4()); |
165 | 171 | * @endcode |
166 | 172 | */ |
| 173 | #ifndef BOOST_NO_EXCEPTIONS |
167 | 174 | void open(const protocol_type& protocol = protocol_type()) |
168 | 175 | { |
169 | 176 | boost::system::error_code ec; |
170 | 177 | this->service.open(this->implementation, protocol, ec); |
171 | 178 | boost::asio::detail::throw_error(ec); |
172 | 179 | } |
| 180 | #endif |
173 | 181 | |
174 | 182 | /// Open the socket using the specified protocol. |
175 | 183 | /** |
… |
… |
|
206 | 214 | * |
207 | 215 | * @throws boost::system::system_error Thrown on failure. |
208 | 216 | */ |
| 217 | #ifndef BOOST_NO_EXCEPTIONS |
209 | 218 | void assign(const protocol_type& protocol, const native_type& native_socket) |
210 | 219 | { |
211 | 220 | boost::system::error_code ec; |
212 | 221 | this->service.assign(this->implementation, protocol, native_socket, ec); |
213 | 222 | boost::asio::detail::throw_error(ec); |
214 | 223 | } |
| 224 | #endif |
215 | 225 | |
216 | 226 | /// Assign an existing native socket to the socket. |
217 | 227 | /* |
… |
… |
|
247 | 257 | * @note For portable behaviour with respect to graceful closure of a |
248 | 258 | * connected socket, call shutdown() before closing the socket. |
249 | 259 | */ |
| 260 | #ifndef BOOST_NO_EXCEPTIONS |
250 | 261 | void close() |
251 | 262 | { |
252 | 263 | boost::system::error_code ec; |
253 | 264 | this->service.close(this->implementation, ec); |
254 | 265 | boost::asio::detail::throw_error(ec); |
255 | 266 | } |
| 267 | #endif |
256 | 268 | |
257 | 269 | /// Close the socket. |
258 | 270 | /** |
… |
… |
|
334 | 346 | "operation_not_supported when used on Windows XP, Windows Server 2003, " |
335 | 347 | "or earlier. Consult documentation for details.")) |
336 | 348 | #endif |
| 349 | #ifndef BOOST_NO_EXCEPTIONS |
337 | 350 | void cancel() |
338 | 351 | { |
339 | 352 | boost::system::error_code ec; |
340 | 353 | this->service.cancel(this->implementation, ec); |
341 | 354 | boost::asio::detail::throw_error(ec); |
342 | 355 | } |
| 356 | #endif |
343 | 357 | |
344 | 358 | /// Cancel all asynchronous operations associated with the socket. |
345 | 359 | /** |
… |
… |
|
397 | 411 | * |
398 | 412 | * @throws boost::system::system_error Thrown on failure. |
399 | 413 | */ |
| 414 | #ifndef BOOST_NO_EXCEPTIONS |
400 | 415 | bool at_mark() const |
401 | 416 | { |
402 | 417 | boost::system::error_code ec; |
… |
… |
|
404 | 419 | boost::asio::detail::throw_error(ec); |
405 | 420 | return b; |
406 | 421 | } |
| 422 | #endif |
407 | 423 | |
408 | 424 | /// Determine whether the socket is at the out-of-band data mark. |
409 | 425 | /** |
… |
… |
|
430 | 446 | * |
431 | 447 | * @throws boost::system::system_error Thrown on failure. |
432 | 448 | */ |
| 449 | #ifndef BOOST_NO_EXCEPTIONS |
433 | 450 | std::size_t available() const |
434 | 451 | { |
435 | 452 | boost::system::error_code ec; |
… |
… |
|
437 | 454 | boost::asio::detail::throw_error(ec); |
438 | 455 | return s; |
439 | 456 | } |
| 457 | #endif |
440 | 458 | |
441 | 459 | /// Determine the number of bytes available for reading. |
442 | 460 | /** |
… |
… |
|
471 | 489 | * boost::asio::ip::tcp::v4(), 12345)); |
472 | 490 | * @endcode |
473 | 491 | */ |
| 492 | #ifndef BOOST_NO_EXCEPTIONS |
474 | 493 | void bind(const endpoint_type& endpoint) |
475 | 494 | { |
476 | 495 | boost::system::error_code ec; |
477 | 496 | this->service.bind(this->implementation, endpoint, ec); |
478 | 497 | boost::asio::detail::throw_error(ec); |
479 | 498 | } |
| 499 | #endif |
480 | 500 | |
481 | 501 | /// Bind the socket to the given local endpoint. |
482 | 502 | /** |
… |
… |
|
530 | 550 | * socket.connect(endpoint); |
531 | 551 | * @endcode |
532 | 552 | */ |
| 553 | #ifndef BOOST_NO_EXCEPTIONS |
533 | 554 | void connect(const endpoint_type& peer_endpoint) |
534 | 555 | { |
535 | 556 | boost::system::error_code ec; |
… |
… |
|
541 | 562 | this->service.connect(this->implementation, peer_endpoint, ec); |
542 | 563 | boost::asio::detail::throw_error(ec); |
543 | 564 | } |
| 565 | #endif |
544 | 566 | |
545 | 567 | /// Connect the socket to the specified endpoint. |
546 | 568 | /** |
… |
… |
|
678 | 700 | * socket.set_option(option); |
679 | 701 | * @endcode |
680 | 702 | */ |
| 703 | #ifndef BOOST_NO_EXCEPTIONS |
681 | 704 | template <typename SettableSocketOption> |
682 | 705 | void set_option(const SettableSocketOption& option) |
683 | 706 | { |
… |
… |
|
685 | 708 | this->service.set_option(this->implementation, option, ec); |
686 | 709 | boost::asio::detail::throw_error(ec); |
687 | 710 | } |
| 711 | #endif |
688 | 712 | |
689 | 713 | /// Set an option on the socket. |
690 | 714 | /** |
… |
… |
|
767 | 791 | * bool is_set = option.get(); |
768 | 792 | * @endcode |
769 | 793 | */ |
| 794 | #ifndef BOOST_NO_EXCEPTIONS |
770 | 795 | template <typename GettableSocketOption> |
771 | 796 | void get_option(GettableSocketOption& option) const |
772 | 797 | { |
… |
… |
|
774 | 799 | this->service.get_option(this->implementation, option, ec); |
775 | 800 | boost::asio::detail::throw_error(ec); |
776 | 801 | } |
| 802 | #endif |
777 | 803 | |
778 | 804 | /// Get an option from the socket. |
779 | 805 | /** |
… |
… |
|
844 | 870 | * std::size_t bytes_readable = command.get(); |
845 | 871 | * @endcode |
846 | 872 | */ |
| 873 | #ifndef BOOST_NO_EXCEPTIONS |
847 | 874 | template <typename IoControlCommand> |
848 | 875 | void io_control(IoControlCommand& command) |
849 | 876 | { |
… |
… |
|
851 | 878 | this->service.io_control(this->implementation, command, ec); |
852 | 879 | boost::asio::detail::throw_error(ec); |
853 | 880 | } |
| 881 | #endif |
854 | 882 | |
855 | 883 | /// Perform an IO control command on the socket. |
856 | 884 | /** |
… |
… |
|
901 | 929 | * boost::asio::ip::tcp::endpoint endpoint = socket.local_endpoint(); |
902 | 930 | * @endcode |
903 | 931 | */ |
| 932 | #ifndef BOOST_NO_EXCEPTIONS |
904 | 933 | endpoint_type local_endpoint() const |
905 | 934 | { |
906 | 935 | boost::system::error_code ec; |
… |
… |
|
908 | 937 | boost::asio::detail::throw_error(ec); |
909 | 938 | return ep; |
910 | 939 | } |
| 940 | #endif |
911 | 941 | |
912 | 942 | /// Get the local endpoint of the socket. |
913 | 943 | /** |
… |
… |
|
950 | 980 | * boost::asio::ip::tcp::endpoint endpoint = socket.remote_endpoint(); |
951 | 981 | * @endcode |
952 | 982 | */ |
| 983 | #ifndef BOOST_NO_EXCEPTIONS |
953 | 984 | endpoint_type remote_endpoint() const |
954 | 985 | { |
955 | 986 | boost::system::error_code ec; |
… |
… |
|
957 | 988 | boost::asio::detail::throw_error(ec); |
958 | 989 | return ep; |
959 | 990 | } |
| 991 | #endif |
960 | 992 | |
961 | 993 | /// Get the remote endpoint of the socket. |
962 | 994 | /** |
… |
… |
|
1001 | 1033 | * socket.shutdown(boost::asio::ip::tcp::socket::shutdown_send); |
1002 | 1034 | * @endcode |
1003 | 1035 | */ |
| 1036 | #ifndef BOOST_NO_EXCEPTIONS |
1004 | 1037 | void shutdown(shutdown_type what) |
1005 | 1038 | { |
1006 | 1039 | boost::system::error_code ec; |
1007 | 1040 | this->service.shutdown(this->implementation, what, ec); |
1008 | 1041 | boost::asio::detail::throw_error(ec); |
1009 | 1042 | } |
| 1043 | #endif |
1010 | 1044 | |
1011 | 1045 | /// Disable sends or receives on the socket. |
1012 | 1046 | /** |
-
diff -ur boost_1_36_0/boost/asio/basic_socket_acceptor.hpp boost_1_36_0_exceptions/boost/asio/basic_socket_acceptor.hpp
old
|
new
|
|
90 | 90 | * |
91 | 91 | * @throws boost::system::system_error Thrown on failure. |
92 | 92 | */ |
| 93 | #ifndef BOOST_NO_EXCEPTIONS |
93 | 94 | basic_socket_acceptor(boost::asio::io_service& io_service, |
94 | 95 | const protocol_type& protocol) |
95 | 96 | : basic_io_object<SocketAcceptorService>(io_service) |
… |
… |
|
98 | 99 | this->service.open(this->implementation, protocol, ec); |
99 | 100 | boost::asio::detail::throw_error(ec); |
100 | 101 | } |
| 102 | #endif |
101 | 103 | |
102 | 104 | /// Construct an acceptor opened on the given endpoint. |
103 | 105 | /** |
… |
… |
|
126 | 128 | * acceptor.listen(listen_backlog); |
127 | 129 | * @endcode |
128 | 130 | */ |
| 131 | #ifndef BOOST_NO_EXCEPTIONS |
129 | 132 | basic_socket_acceptor(boost::asio::io_service& io_service, |
130 | 133 | const endpoint_type& endpoint, bool reuse_addr = true) |
131 | 134 | : basic_io_object<SocketAcceptorService>(io_service) |
… |
… |
|
145 | 148 | socket_base::max_connections, ec); |
146 | 149 | boost::asio::detail::throw_error(ec); |
147 | 150 | } |
| 151 | #endif |
148 | 152 | |
149 | 153 | /// Construct a basic_socket_acceptor on an existing native acceptor. |
150 | 154 | /** |
… |
… |
|
161 | 165 | * |
162 | 166 | * @throws boost::system::system_error Thrown on failure. |
163 | 167 | */ |
| 168 | #ifndef BOOST_NO_EXCEPTIONS |
164 | 169 | basic_socket_acceptor(boost::asio::io_service& io_service, |
165 | 170 | const protocol_type& protocol, const native_type& native_acceptor) |
166 | 171 | : basic_io_object<SocketAcceptorService>(io_service) |
… |
… |
|
169 | 174 | this->service.assign(this->implementation, protocol, native_acceptor, ec); |
170 | 175 | boost::asio::detail::throw_error(ec); |
171 | 176 | } |
| 177 | #endif |
172 | 178 | |
173 | 179 | /// Open the acceptor using the specified protocol. |
174 | 180 | /** |
… |
… |
|
185 | 191 | * acceptor.open(boost::asio::ip::tcp::v4()); |
186 | 192 | * @endcode |
187 | 193 | */ |
| 194 | #ifndef BOOST_NO_EXCEPTIONS |
188 | 195 | void open(const protocol_type& protocol = protocol_type()) |
189 | 196 | { |
190 | 197 | boost::system::error_code ec; |
191 | 198 | this->service.open(this->implementation, protocol, ec); |
192 | 199 | boost::asio::detail::throw_error(ec); |
193 | 200 | } |
| 201 | #endif |
194 | 202 | |
195 | 203 | /// Open the acceptor using the specified protocol. |
196 | 204 | /** |
… |
… |
|
228 | 236 | * |
229 | 237 | * @throws boost::system::system_error Thrown on failure. |
230 | 238 | */ |
| 239 | #ifndef BOOST_NO_EXCEPTIONS |
231 | 240 | void assign(const protocol_type& protocol, const native_type& native_acceptor) |
232 | 241 | { |
233 | 242 | boost::system::error_code ec; |
234 | 243 | this->service.assign(this->implementation, protocol, native_acceptor, ec); |
235 | 244 | boost::asio::detail::throw_error(ec); |
236 | 245 | } |
| 246 | #endif |
237 | 247 | |
238 | 248 | /// Assigns an existing native acceptor to the acceptor. |
239 | 249 | /* |
… |
… |
|
275 | 285 | * acceptor.bind(boost::asio::ip::tcp::endpoint(12345)); |
276 | 286 | * @endcode |
277 | 287 | */ |
| 288 | #ifndef BOOST_NO_EXCEPTIONS |
278 | 289 | void bind(const endpoint_type& endpoint) |
279 | 290 | { |
280 | 291 | boost::system::error_code ec; |
281 | 292 | this->service.bind(this->implementation, endpoint, ec); |
282 | 293 | boost::asio::detail::throw_error(ec); |
283 | 294 | } |
| 295 | #endif |
284 | 296 | |
285 | 297 | /// Bind the acceptor to the given local endpoint. |
286 | 298 | /** |
… |
… |
|
320 | 332 | * |
321 | 333 | * @throws boost::system::system_error Thrown on failure. |
322 | 334 | */ |
| 335 | #ifndef BOOST_NO_EXCEPTIONS |
323 | 336 | void listen(int backlog = socket_base::max_connections) |
324 | 337 | { |
325 | 338 | boost::system::error_code ec; |
326 | 339 | this->service.listen(this->implementation, backlog, ec); |
327 | 340 | boost::asio::detail::throw_error(ec); |
328 | 341 | } |
| 342 | #endif |
329 | 343 | |
330 | 344 | /// Place the acceptor into the state where it will listen for new |
331 | 345 | /// connections. |
… |
… |
|
364 | 378 | * |
365 | 379 | * @throws boost::system::system_error Thrown on failure. |
366 | 380 | */ |
| 381 | #ifndef BOOST_NO_EXCEPTIONS |
367 | 382 | void close() |
368 | 383 | { |
369 | 384 | boost::system::error_code ec; |
370 | 385 | this->service.close(this->implementation, ec); |
371 | 386 | boost::asio::detail::throw_error(ec); |
372 | 387 | } |
| 388 | #endif |
373 | 389 | |
374 | 390 | /// Close the acceptor. |
375 | 391 | /** |
… |
… |
|
417 | 433 | * |
418 | 434 | * @throws boost::system::system_error Thrown on failure. |
419 | 435 | */ |
| 436 | #ifndef BOOST_NO_EXCEPTIONS |
420 | 437 | void cancel() |
421 | 438 | { |
422 | 439 | boost::system::error_code ec; |
423 | 440 | this->service.cancel(this->implementation, ec); |
424 | 441 | boost::asio::detail::throw_error(ec); |
425 | 442 | } |
| 443 | #endif |
426 | 444 | |
427 | 445 | /// Cancel all asynchronous operations associated with the acceptor. |
428 | 446 | /** |
… |
… |
|
458 | 476 | * acceptor.set_option(option); |
459 | 477 | * @endcode |
460 | 478 | */ |
| 479 | #ifndef BOOST_NO_EXCEPTIONS |
461 | 480 | template <typename SettableSocketOption> |
462 | 481 | void set_option(const SettableSocketOption& option) |
463 | 482 | { |
… |
… |
|
465 | 484 | this->service.set_option(this->implementation, option, ec); |
466 | 485 | boost::asio::detail::throw_error(ec); |
467 | 486 | } |
| 487 | #endif |
468 | 488 | |
469 | 489 | /// Set an option on the acceptor. |
470 | 490 | /** |
… |
… |
|
521 | 541 | * bool is_set = option.get(); |
522 | 542 | * @endcode |
523 | 543 | */ |
| 544 | #ifndef BOOST_NO_EXCEPTIONS |
524 | 545 | template <typename GettableSocketOption> |
525 | 546 | void get_option(GettableSocketOption& option) |
526 | 547 | { |
… |
… |
|
528 | 549 | this->service.get_option(this->implementation, option, ec); |
529 | 550 | boost::asio::detail::throw_error(ec); |
530 | 551 | } |
| 552 | #endif |
531 | 553 | |
532 | 554 | /// Get an option from the acceptor. |
533 | 555 | /** |
… |
… |
|
578 | 600 | * boost::asio::ip::tcp::endpoint endpoint = acceptor.local_endpoint(); |
579 | 601 | * @endcode |
580 | 602 | */ |
| 603 | #ifndef BOOST_NO_EXCEPTIONS |
581 | 604 | endpoint_type local_endpoint() const |
582 | 605 | { |
583 | 606 | boost::system::error_code ec; |
… |
… |
|
585 | 608 | boost::asio::detail::throw_error(ec); |
586 | 609 | return ep; |
587 | 610 | } |
| 611 | #endif |
588 | 612 | |
589 | 613 | /// Get the local endpoint of the acceptor. |
590 | 614 | /** |
… |
… |
|
631 | 655 | * acceptor.accept(socket); |
632 | 656 | * @endcode |
633 | 657 | */ |
| 658 | #ifndef BOOST_NO_EXCEPTIONS |
634 | 659 | template <typename SocketService> |
635 | 660 | void accept(basic_socket<protocol_type, SocketService>& peer) |
636 | 661 | { |
… |
… |
|
638 | 663 | this->service.accept(this->implementation, peer, 0, ec); |
639 | 664 | boost::asio::detail::throw_error(ec); |
640 | 665 | } |
| 666 | #endif |
641 | 667 | |
642 | 668 | /// Accept a new connection. |
643 | 669 | /** |
… |
… |
|
738 | 764 | * acceptor.accept(socket, endpoint); |
739 | 765 | * @endcode |
740 | 766 | */ |
| 767 | #ifndef BOOST_NO_EXCEPTIONS |
741 | 768 | template <typename SocketService> |
742 | 769 | void accept(basic_socket<protocol_type, SocketService>& peer, |
743 | 770 | endpoint_type& peer_endpoint) |
… |
… |
|
746 | 773 | this->service.accept(this->implementation, peer, &peer_endpoint, ec); |
747 | 774 | boost::asio::detail::throw_error(ec); |
748 | 775 | } |
| 776 | #endif |
749 | 777 | |
750 | 778 | /// Accept a new connection and obtain the endpoint of the peer |
751 | 779 | /** |
-
diff -ur boost_1_36_0/boost/asio/basic_stream_socket.hpp boost_1_36_0_exceptions/boost/asio/basic_stream_socket.hpp
old
|
new
|
|
156 | 156 | * buffers in one go, and how to use it with arrays, boost::array or |
157 | 157 | * std::vector. |
158 | 158 | */ |
| 159 | #ifndef BOOST_NO_EXCEPTIONS |
159 | 160 | template <typename ConstBufferSequence> |
160 | 161 | std::size_t send(const ConstBufferSequence& buffers) |
161 | 162 | { |
… |
… |
|
165 | 166 | boost::asio::detail::throw_error(ec); |
166 | 167 | return s; |
167 | 168 | } |
| 169 | #endif |
168 | 170 | |
169 | 171 | /// Send some data on the socket. |
170 | 172 | /** |
… |
… |
|
193 | 195 | * buffers in one go, and how to use it with arrays, boost::array or |
194 | 196 | * std::vector. |
195 | 197 | */ |
| 198 | #ifndef BOOST_NO_EXCEPTIONS |
196 | 199 | template <typename ConstBufferSequence> |
197 | 200 | std::size_t send(const ConstBufferSequence& buffers, |
198 | 201 | socket_base::message_flags flags) |
… |
… |
|
203 | 206 | boost::asio::detail::throw_error(ec); |
204 | 207 | return s; |
205 | 208 | } |
| 209 | #endif |
206 | 210 | |
207 | 211 | /// Send some data on the socket. |
208 | 212 | /** |
… |
… |
|
342 | 346 | * multiple buffers in one go, and how to use it with arrays, boost::array or |
343 | 347 | * std::vector. |
344 | 348 | */ |
| 349 | #ifndef BOOST_NO_EXCEPTIONS |
345 | 350 | template <typename MutableBufferSequence> |
346 | 351 | std::size_t receive(const MutableBufferSequence& buffers) |
347 | 352 | { |
… |
… |
|
350 | 355 | boost::asio::detail::throw_error(ec); |
351 | 356 | return s; |
352 | 357 | } |
| 358 | #endif |
353 | 359 | |
354 | 360 | /// Receive some data on the socket. |
355 | 361 | /** |
… |
… |
|
381 | 387 | * multiple buffers in one go, and how to use it with arrays, boost::array or |
382 | 388 | * std::vector. |
383 | 389 | */ |
| 390 | #ifndef BOOST_NO_EXCEPTIONS |
384 | 391 | template <typename MutableBufferSequence> |
385 | 392 | std::size_t receive(const MutableBufferSequence& buffers, |
386 | 393 | socket_base::message_flags flags) |
… |
… |
|
391 | 398 | boost::asio::detail::throw_error(ec); |
392 | 399 | return s; |
393 | 400 | } |
| 401 | #endif |
394 | 402 | |
395 | 403 | /// Receive some data on a connected socket. |
396 | 404 | /** |
… |
… |
|
533 | 541 | * buffers in one go, and how to use it with arrays, boost::array or |
534 | 542 | * std::vector. |
535 | 543 | */ |
| 544 | #ifndef BOOST_NO_EXCEPTIONS |
536 | 545 | template <typename ConstBufferSequence> |
537 | 546 | std::size_t write_some(const ConstBufferSequence& buffers) |
538 | 547 | { |
… |
… |
|
541 | 550 | boost::asio::detail::throw_error(ec); |
542 | 551 | return s; |
543 | 552 | } |
| 553 | #endif |
544 | 554 | |
545 | 555 | /// Write some data to the socket. |
546 | 556 | /** |
… |
… |
|
635 | 645 | * buffers in one go, and how to use it with arrays, boost::array or |
636 | 646 | * std::vector. |
637 | 647 | */ |
| 648 | #ifndef BOOST_NO_EXCEPTIONS |
638 | 649 | template <typename MutableBufferSequence> |
639 | 650 | std::size_t read_some(const MutableBufferSequence& buffers) |
640 | 651 | { |
… |
… |
|
643 | 654 | boost::asio::detail::throw_error(ec); |
644 | 655 | return s; |
645 | 656 | } |
| 657 | #endif |
646 | 658 | |
647 | 659 | /// Read some data from the socket. |
648 | 660 | /** |
-
diff -ur boost_1_36_0/boost/asio/detail/resolver_service.hpp boost_1_36_0_exceptions/boost/asio/detail/resolver_service.hpp
old
|
new
|
|
321 | 321 | public: |
322 | 322 | work_io_service_runner(boost::asio::io_service& io_service) |
323 | 323 | : io_service_(io_service) {} |
324 | | void operator()() { io_service_.run(); } |
| 324 | void operator()() |
| 325 | { |
| 326 | boost::system::error_code ec; |
| 327 | io_service_.run(ec); |
| 328 | #ifndef BOOST_NO_EXCEPTIONS |
| 329 | throw_error(ec); |
| 330 | #endif |
| 331 | } |
325 | 332 | private: |
326 | 333 | boost::asio::io_service& io_service_; |
327 | 334 | }; |
-
diff -ur boost_1_36_0/boost/asio/detail/throw_error.hpp boost_1_36_0_exceptions/boost/asio/detail/throw_error.hpp
old
|
new
|
|
28 | 28 | namespace asio { |
29 | 29 | namespace detail { |
30 | 30 | |
| 31 | #ifndef BOOST_NO_EXCEPTIONS |
31 | 32 | inline void throw_error(const boost::system::error_code& err) |
32 | 33 | { |
33 | 34 | if (err) |
… |
… |
|
36 | 37 | boost::throw_exception(e); |
37 | 38 | } |
38 | 39 | } |
| 40 | #endif |
39 | 41 | |
40 | 42 | } // namespace detail |
41 | 43 | } // namespace asio |
-
diff -ur boost_1_36_0/boost/asio/impl/io_service.ipp boost_1_36_0_exceptions/boost/asio/impl/io_service.ipp
old
|
new
|
|
52 | 52 | delete service_registry_; |
53 | 53 | } |
54 | 54 | |
| 55 | #ifndef BOOST_NO_EXCEPTIONS |
55 | 56 | inline std::size_t io_service::run() |
56 | 57 | { |
57 | 58 | boost::system::error_code ec; |
… |
… |
|
59 | 60 | boost::asio::detail::throw_error(ec); |
60 | 61 | return s; |
61 | 62 | } |
| 63 | #endif |
62 | 64 | |
63 | 65 | inline std::size_t io_service::run(boost::system::error_code& ec) |
64 | 66 | { |
65 | 67 | return impl_.run(ec); |
66 | 68 | } |
67 | 69 | |
| 70 | #ifndef BOOST_NO_EXCEPTIONS |
68 | 71 | inline std::size_t io_service::run_one() |
69 | 72 | { |
70 | 73 | boost::system::error_code ec; |
… |
… |
|
72 | 75 | boost::asio::detail::throw_error(ec); |
73 | 76 | return s; |
74 | 77 | } |
| 78 | #endif |
75 | 79 | |
76 | 80 | inline std::size_t io_service::run_one(boost::system::error_code& ec) |
77 | 81 | { |
78 | 82 | return impl_.run_one(ec); |
79 | 83 | } |
80 | 84 | |
| 85 | #ifndef BOOST_NO_EXCEPTIONS |
81 | 86 | inline std::size_t io_service::poll() |
82 | 87 | { |
83 | 88 | boost::system::error_code ec; |
… |
… |
|
85 | 90 | boost::asio::detail::throw_error(ec); |
86 | 91 | return s; |
87 | 92 | } |
| 93 | #endif |
88 | 94 | |
89 | 95 | inline std::size_t io_service::poll(boost::system::error_code& ec) |
90 | 96 | { |
91 | 97 | return impl_.poll(ec); |
92 | 98 | } |
93 | 99 | |
| 100 | #ifndef BOOST_NO_EXCEPTIONS |
94 | 101 | inline std::size_t io_service::poll_one() |
95 | 102 | { |
96 | 103 | boost::system::error_code ec; |
… |
… |
|
98 | 105 | boost::asio::detail::throw_error(ec); |
99 | 106 | return s; |
100 | 107 | } |
| 108 | #endif |
101 | 109 | |
102 | 110 | inline std::size_t io_service::poll_one(boost::system::error_code& ec) |
103 | 111 | { |
-
diff -ur boost_1_36_0/boost/asio/impl/read.ipp boost_1_36_0_exceptions/boost/asio/impl/read.ipp
old
|
new
|
|
53 | 53 | return total_transferred; |
54 | 54 | } |
55 | 55 | |
| 56 | #ifndef BOOST_NO_EXCEPTIONS |
56 | 57 | template <typename SyncReadStream, typename MutableBufferSequence> |
57 | 58 | inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers) |
58 | 59 | { |
… |
… |
|
72 | 73 | boost::asio::detail::throw_error(ec); |
73 | 74 | return bytes_transferred; |
74 | 75 | } |
| 76 | #endif |
75 | 77 | |
76 | 78 | template <typename SyncReadStream, typename Allocator, |
77 | 79 | typename CompletionCondition> |
… |
… |
|
93 | 95 | } |
94 | 96 | } |
95 | 97 | |
| 98 | #ifndef BOOST_NO_EXCEPTIONS |
96 | 99 | template <typename SyncReadStream, typename Allocator> |
97 | 100 | inline std::size_t read(SyncReadStream& s, |
98 | 101 | boost::asio::basic_streambuf<Allocator>& b) |
… |
… |
|
114 | 117 | boost::asio::detail::throw_error(ec); |
115 | 118 | return bytes_transferred; |
116 | 119 | } |
| 120 | #endif |
117 | 121 | |
118 | 122 | namespace detail |
119 | 123 | { |
-
diff -ur boost_1_36_0/boost/asio/impl/write.ipp boost_1_36_0_exceptions/boost/asio/impl/write.ipp
old
|
new
|
|
48 | 48 | return total_transferred; |
49 | 49 | } |
50 | 50 | |
| 51 | #ifndef BOOST_NO_EXCEPTIONS |
51 | 52 | template <typename SyncWriteStream, typename ConstBufferSequence> |
52 | 53 | inline std::size_t write(SyncWriteStream& s, const ConstBufferSequence& buffers) |
53 | 54 | { |
… |
… |
|
67 | 68 | boost::asio::detail::throw_error(ec); |
68 | 69 | return bytes_transferred; |
69 | 70 | } |
| 71 | #endif |
70 | 72 | |
71 | 73 | template <typename SyncWriteStream, typename Allocator, |
72 | 74 | typename CompletionCondition> |
… |
… |
|
79 | 81 | return bytes_transferred; |
80 | 82 | } |
81 | 83 | |
| 84 | #ifndef BOOST_NO_EXCEPTIONS |
82 | 85 | template <typename SyncWriteStream, typename Allocator> |
83 | 86 | inline std::size_t write(SyncWriteStream& s, |
84 | 87 | boost::asio::basic_streambuf<Allocator>& b) |
… |
… |
|
100 | 103 | boost::asio::detail::throw_error(ec); |
101 | 104 | return bytes_transferred; |
102 | 105 | } |
| 106 | #endif |
103 | 107 | |
104 | 108 | namespace detail |
105 | 109 | { |
-
diff -ur boost_1_36_0/boost/asio/io_service.hpp boost_1_36_0_exceptions/boost/asio/io_service.hpp
old
|
new
|
|
190 | 190 | * @note The poll() function may also be used to dispatch ready handlers, |
191 | 191 | * but without blocking. |
192 | 192 | */ |
| 193 | #ifndef BOOST_NO_EXCEPTIONS |
193 | 194 | std::size_t run(); |
| 195 | #endif |
194 | 196 | |
195 | 197 | /// Run the io_service's event processing loop. |
196 | 198 | /** |
… |
… |
|
223 | 225 | * |
224 | 226 | * @throws boost::system::system_error Thrown on failure. |
225 | 227 | */ |
| 228 | #ifndef BOOST_NO_EXCEPTIONS |
226 | 229 | std::size_t run_one(); |
| 230 | #endif |
227 | 231 | |
228 | 232 | /// Run the io_service's event processing loop to execute at most one handler. |
229 | 233 | /** |
… |
… |
|
245 | 249 | * |
246 | 250 | * @throws boost::system::system_error Thrown on failure. |
247 | 251 | */ |
| 252 | #ifndef BOOST_NO_EXCEPTIONS |
248 | 253 | std::size_t poll(); |
| 254 | #endif |
249 | 255 | |
250 | 256 | /// Run the io_service's event processing loop to execute ready handlers. |
251 | 257 | /** |
… |
… |
|
267 | 273 | * |
268 | 274 | * @throws boost::system::system_error Thrown on failure. |
269 | 275 | */ |
| 276 | #ifndef BOOST_NO_EXCEPTIONS |
270 | 277 | std::size_t poll_one(); |
| 278 | #endif |
271 | 279 | |
272 | 280 | /// Run the io_service's event processing loop to execute one ready handler. |
273 | 281 | /** |
-
diff -ur boost_1_36_0/boost/asio/ip/address.hpp boost_1_36_0_exceptions/boost/asio/ip/address.hpp
old
|
new
|
|
120 | 120 | { |
121 | 121 | if (type_ != ipv4) |
122 | 122 | { |
| 123 | #ifdef BOOST_NO_EXCEPTIONS |
| 124 | return boost::asio::ip::address_v4(); |
| 125 | #else |
123 | 126 | boost::system::system_error e( |
124 | 127 | boost::asio::error::address_family_not_supported); |
125 | 128 | boost::throw_exception(e); |
| 129 | #endif |
126 | 130 | } |
127 | 131 | return ipv4_address_; |
128 | 132 | } |
… |
… |
|
132 | 136 | { |
133 | 137 | if (type_ != ipv6) |
134 | 138 | { |
| 139 | #ifdef BOOST_NO_EXCEPTIONS |
| 140 | return boost::asio::ip::address_v6(); |
| 141 | #else |
135 | 142 | boost::system::system_error e( |
136 | 143 | boost::asio::error::address_family_not_supported); |
137 | 144 | boost::throw_exception(e); |
| 145 | #endif |
138 | 146 | } |
139 | 147 | return ipv6_address_; |
140 | 148 | } |
141 | 149 | |
142 | 150 | /// Get the address as a string in dotted decimal format. |
| 151 | #ifndef BOOST_NO_EXCEPTIONS |
143 | 152 | std::string to_string() const |
144 | 153 | { |
145 | 154 | if (type_ == ipv6) |
146 | 155 | return ipv6_address_.to_string(); |
147 | 156 | return ipv4_address_.to_string(); |
148 | 157 | } |
| 158 | #endif |
149 | 159 | |
150 | 160 | /// Get the address as a string in dotted decimal format. |
151 | 161 | std::string to_string(boost::system::error_code& ec) const |
… |
… |
|
157 | 167 | |
158 | 168 | /// Create an address from an IPv4 address string in dotted decimal form, |
159 | 169 | /// or from an IPv6 address in hexadecimal notation. |
| 170 | #ifndef BOOST_NO_EXCEPTIONS |
160 | 171 | static address from_string(const char* str) |
161 | 172 | { |
162 | 173 | boost::system::error_code ec; |
… |
… |
|
164 | 175 | boost::asio::detail::throw_error(ec); |
165 | 176 | return addr; |
166 | 177 | } |
| 178 | #endif |
167 | 179 | |
168 | 180 | /// Create an address from an IPv4 address string in dotted decimal form, |
169 | 181 | /// or from an IPv6 address in hexadecimal notation. |
… |
… |
|
192 | 204 | return address(); |
193 | 205 | } |
194 | 206 | |
| 207 | #ifndef BOOST_NO_EXCEPTIONS |
195 | 208 | /// Create an address from an IPv4 address string in dotted decimal form, |
196 | 209 | /// or from an IPv6 address in hexadecimal notation. |
197 | 210 | static address from_string(const std::string& str) |
198 | 211 | { |
199 | 212 | return from_string(str.c_str()); |
200 | 213 | } |
| 214 | #endif |
201 | 215 | |
202 | 216 | /// Create an address from an IPv4 address string in dotted decimal form, |
203 | 217 | /// or from an IPv6 address in hexadecimal notation. |
… |
… |
|
266 | 280 | std::basic_ostream<Elem, Traits>& operator<<( |
267 | 281 | std::basic_ostream<Elem, Traits>& os, const address& addr) |
268 | 282 | { |
269 | | os << addr.to_string(); |
| 283 | if (addr.is_v4()) os << addr.to_v4(); |
| 284 | else os << addr.to_v6(); |
270 | 285 | return os; |
271 | 286 | } |
272 | 287 | |
-
diff -ur boost_1_36_0/boost/asio/ip/address_v4.hpp boost_1_36_0_exceptions/boost/asio/ip/address_v4.hpp
old
|
new
|
|
94 | 94 | return boost::asio::detail::socket_ops::network_to_host_long(addr_.s_addr); |
95 | 95 | } |
96 | 96 | |
| 97 | #ifndef BOOST_NO_EXCEPTIONS |
97 | 98 | /// Get the address as a string in dotted decimal format. |
98 | 99 | std::string to_string() const |
99 | 100 | { |
… |
… |
|
102 | 103 | boost::asio::detail::throw_error(ec); |
103 | 104 | return addr; |
104 | 105 | } |
| 106 | #endif |
105 | 107 | |
106 | 108 | /// Get the address as a string in dotted decimal format. |
107 | 109 | std::string to_string(boost::system::error_code& ec) const |
… |
… |
|
115 | 117 | return addr; |
116 | 118 | } |
117 | 119 | |
| 120 | #ifndef BOOST_NO_EXCEPTIONS |
118 | 121 | /// Create an address from an IP address string in dotted decimal form. |
119 | 122 | static address_v4 from_string(const char* str) |
120 | 123 | { |
… |
… |
|
123 | 126 | boost::asio::detail::throw_error(ec); |
124 | 127 | return addr; |
125 | 128 | } |
| 129 | #endif |
126 | 130 | |
127 | 131 | /// Create an address from an IP address string in dotted decimal form. |
128 | 132 | static address_v4 from_string(const char* str, boost::system::error_code& ec) |
… |
… |
|
134 | 138 | return tmp; |
135 | 139 | } |
136 | 140 | |
| 141 | #ifndef BOOST_NO_EXCEPTIONS |
137 | 142 | /// Create an address from an IP address string in dotted decimal form. |
138 | 143 | static address_v4 from_string(const std::string& str) |
139 | 144 | { |
140 | 145 | return from_string(str.c_str()); |
141 | 146 | } |
| 147 | #endif |
142 | 148 | |
143 | 149 | /// Create an address from an IP address string in dotted decimal form. |
144 | 150 | static address_v4 from_string(const std::string& str, |
… |
… |
|
270 | 276 | std::string s = addr.to_string(ec); |
271 | 277 | if (ec) |
272 | 278 | { |
| 279 | #ifndef BOOST_NO_EXCEPTIONS |
273 | 280 | if (os.exceptions() & std::ios::failbit) |
274 | 281 | boost::asio::detail::throw_error(ec); |
275 | 282 | else |
| 283 | #endif |
276 | 284 | os.setstate(std::ios_base::failbit); |
277 | 285 | } |
278 | 286 | else |
-
diff -ur boost_1_36_0/boost/asio/ip/address_v6.hpp boost_1_36_0_exceptions/boost/asio/ip/address_v6.hpp
old
|
new
|
|
109 | 109 | return bytes; |
110 | 110 | } |
111 | 111 | |
| 112 | #ifndef BOOST_NO_EXCEPTIONS |
112 | 113 | /// Get the address as a string. |
113 | 114 | std::string to_string() const |
114 | 115 | { |
… |
… |
|
117 | 118 | boost::asio::detail::throw_error(ec); |
118 | 119 | return addr; |
119 | 120 | } |
| 121 | #endif |
120 | 122 | |
121 | 123 | /// Get the address as a string. |
122 | 124 | std::string to_string(boost::system::error_code& ec) const |
… |
… |
|
130 | 132 | return addr; |
131 | 133 | } |
132 | 134 | |
| 135 | #ifndef BOOST_NO_EXCEPTIONS |
133 | 136 | /// Create an address from an IP address string. |
134 | 137 | static address_v6 from_string(const char* str) |
135 | 138 | { |
… |
… |
|
138 | 141 | boost::asio::detail::throw_error(ec); |
139 | 142 | return addr; |
140 | 143 | } |
| 144 | #endif |
141 | 145 | |
142 | 146 | /// Create an address from an IP address string. |
143 | 147 | static address_v6 from_string(const char* str, boost::system::error_code& ec) |
… |
… |
|
149 | 153 | return tmp; |
150 | 154 | } |
151 | 155 | |
| 156 | #ifndef BOOST_NO_EXCEPTIONS |
152 | 157 | /// Create an address from an IP address string. |
153 | 158 | static address_v6 from_string(const std::string& str) |
154 | 159 | { |
155 | 160 | return from_string(str.c_str()); |
156 | 161 | } |
| 162 | #endif |
157 | 163 | |
158 | 164 | /// Create an address from an IP address string. |
159 | 165 | static address_v6 from_string(const std::string& str, |
… |
… |
|
166 | 172 | address_v4 to_v4() const |
167 | 173 | { |
168 | 174 | if (!is_v4_mapped() && !is_v4_compatible()) |
| 175 | #ifdef BOOST_NO_EXCEPTIONS |
| 176 | return address_v4(); |
| 177 | #else |
169 | 178 | throw std::bad_cast(); |
| 179 | #endif |
170 | 180 | address_v4::bytes_type v4_bytes = { { addr_.s6_addr[12], |
171 | 181 | addr_.s6_addr[13], addr_.s6_addr[14], addr_.s6_addr[15] } }; |
172 | 182 | return address_v4(v4_bytes); |
… |
… |
|
388 | 398 | std::string s = addr.to_string(ec); |
389 | 399 | if (ec) |
390 | 400 | { |
| 401 | #ifndef BOOST_NO_EXCEPTIONS |
391 | 402 | if (os.exceptions() & std::ios::failbit) |
392 | 403 | boost::asio::detail::throw_error(ec); |
393 | 404 | else |
| 405 | #endif |
394 | 406 | os.setstate(std::ios_base::failbit); |
395 | 407 | } |
396 | 408 | else |
-
diff -ur boost_1_36_0/boost/asio/ip/basic_endpoint.hpp boost_1_36_0_exceptions/boost/asio/ip/basic_endpoint.hpp
old
|
new
|
|
318 | 318 | std::string a = addr.to_string(ec); |
319 | 319 | if (ec) |
320 | 320 | { |
| 321 | #ifndef BOOST_NO_EXCEPTIONS |
321 | 322 | if (os.exceptions() & std::ios::failbit) |
322 | 323 | boost::asio::detail::throw_error(ec); |
323 | 324 | else |
| 325 | #endif |
324 | 326 | os.setstate(std::ios_base::failbit); |
325 | 327 | } |
326 | 328 | else |
… |
… |
|
344 | 346 | std::string a = addr.to_string(ec); |
345 | 347 | if (ec) |
346 | 348 | { |
| 349 | #ifndef BOOST_NO_EXCEPTIONS |
347 | 350 | if (os.exceptions() & std::ios::failbit) |
348 | 351 | boost::asio::detail::throw_error(ec); |
349 | 352 | else |
| 353 | #endif |
350 | 354 | os.setstate(std::ios_base::failbit); |
351 | 355 | } |
352 | 356 | else |
-
diff -ur boost_1_36_0/boost/asio/ip/basic_resolver.hpp boost_1_36_0_exceptions/boost/asio/ip/basic_resolver.hpp
old
|
new
|
|
92 | 92 | * A successful call to this function is guaranteed to return at least one |
93 | 93 | * entry. |
94 | 94 | */ |
| 95 | #ifndef BOOST_NO_EXCEPTIONS |
95 | 96 | iterator resolve(const query& q) |
96 | 97 | { |
97 | 98 | boost::system::error_code ec; |
… |
… |
|
99 | 100 | boost::asio::detail::throw_error(ec); |
100 | 101 | return i; |
101 | 102 | } |
| 103 | #endif |
102 | 104 | |
103 | 105 | /// Resolve a query to a list of entries. |
104 | 106 | /** |
… |
… |
|
172 | 174 | * A successful call to this function is guaranteed to return at least one |
173 | 175 | * entry. |
174 | 176 | */ |
| 177 | #ifndef BOOST_NO_EXCEPTIONS |
175 | 178 | iterator resolve(const endpoint_type& e) |
176 | 179 | { |
177 | 180 | boost::system::error_code ec; |
… |
… |
|
179 | 182 | boost::asio::detail::throw_error(ec); |
180 | 183 | return i; |
181 | 184 | } |
| 185 | #endif |
182 | 186 | |
183 | 187 | /// Resolve an endpoint to a list of entries. |
184 | 188 | /** |
-
diff -ur boost_1_36_0/boost/asio/ip/detail/socket_option.hpp boost_1_36_0_exceptions/boost/asio/ip/detail/socket_option.hpp
old
|
new
|
|
140 | 140 | { |
141 | 141 | if (protocol.family() == PF_INET6) |
142 | 142 | { |
| 143 | #ifndef BOOST_NO_EXCEPTIONS |
143 | 144 | if (s != sizeof(ipv6_value_)) |
144 | 145 | { |
145 | 146 | throw std::length_error( |
146 | 147 | "multicast_enable_loopback socket option resize"); |
147 | 148 | } |
| 149 | #else |
| 150 | BOOST_ASSERT(s == sizeof(ipv6_value_)); |
| 151 | #endif |
148 | 152 | ipv4_value_ = ipv6_value_ ? 1 : 0; |
149 | 153 | } |
150 | 154 | else |
151 | 155 | { |
| 156 | #ifndef BOOST_NO_EXCEPTIONS |
152 | 157 | if (s != sizeof(ipv4_value_)) |
153 | 158 | { |
154 | 159 | throw std::length_error( |
155 | 160 | "multicast_enable_loopback socket option resize"); |
156 | 161 | } |
| 162 | #else |
| 163 | BOOST_ASSERT(s == sizeof(ipv4_value_)); |
| 164 | #endif |
157 | 165 | ipv6_value_ = ipv4_value_ ? 1 : 0; |
158 | 166 | } |
159 | 167 | } |
… |
… |
|
236 | 244 | template <typename Protocol> |
237 | 245 | void resize(const Protocol&, std::size_t s) |
238 | 246 | { |
| 247 | #ifndef BOOST_NO_EXCEPTIONS |
239 | 248 | if (s != sizeof(value_)) |
240 | 249 | throw std::length_error("unicast hops socket option resize"); |
| 250 | #else |
| 251 | BOOST_ASSERT(s == sizeof(value_)); |
| 252 | #endif |
241 | 253 | #if defined(__hpux) |
242 | 254 | if (value_ < 0) |
243 | 255 | value_ = value_ & 0xFF; |
… |
… |
|
270 | 282 | // Construct with a specific option value. |
271 | 283 | explicit multicast_hops(int v) |
272 | 284 | { |
| 285 | #ifndef BOOST_NO_EXCEPTIONS |
273 | 286 | if (v < 0 || v > 255) |
274 | 287 | throw std::out_of_range("multicast hops value out of range"); |
| 288 | #else |
| 289 | BOOST_ASSERT(v >= 0 && v <= 255); |
| 290 | #endif |
275 | 291 | ipv4_value_ = (ipv4_value_type)v; |
276 | 292 | ipv6_value_ = v; |
277 | 293 | } |
… |
… |
|
279 | 295 | // Set the value of the option. |
280 | 296 | multicast_hops& operator=(int v) |
281 | 297 | { |
| 298 | #ifndef BOOST_NO_EXCEPTIONS |
282 | 299 | if (v < 0 || v > 255) |
283 | 300 | throw std::out_of_range("multicast hops value out of range"); |
| 301 | #else |
| 302 | BOOST_ASSERT(v >= 0 && v <= 255); |
| 303 | #endif |
284 | 304 | ipv4_value_ = (ipv4_value_type)v; |
285 | 305 | ipv6_value_ = v; |
286 | 306 | return *this; |
… |
… |
|
343 | 363 | { |
344 | 364 | if (protocol.family() == PF_INET6) |
345 | 365 | { |
| 366 | #ifndef BOOST_NO_EXCEPTIONS |
346 | 367 | if (s != sizeof(ipv6_value_)) |
347 | 368 | throw std::length_error("multicast hops socket option resize"); |
| 369 | #else |
| 370 | BOOST_ASSERT(s == sizeof(ipv6_value_)); |
| 371 | #endif |
348 | 372 | if (ipv6_value_ < 0) |
349 | 373 | ipv4_value_ = 0; |
350 | 374 | else if (ipv6_value_ > 255) |
… |
… |
|
354 | 378 | } |
355 | 379 | else |
356 | 380 | { |
| 381 | #ifndef BOOST_NO_EXCEPTIONS |
357 | 382 | if (s != sizeof(ipv4_value_)) |
358 | 383 | throw std::length_error("multicast hops socket option resize"); |
| 384 | #else |
| 385 | BOOST_ASSERT(s == sizeof(ipv4_value_)); |
| 386 | #endif |
359 | 387 | ipv6_value_ = ipv4_value_; |
360 | 388 | } |
361 | 389 | } |
-
diff -ur boost_1_36_0/boost/asio/ip/host_name.hpp boost_1_36_0_exceptions/boost/asio/ip/host_name.hpp
old
|
new
|
|
35 | 35 | /// Get the current host name. |
36 | 36 | std::string host_name(boost::system::error_code& ec); |
37 | 37 | |
| 38 | #ifndef BOOST_NO_EXCEPTIONS |
38 | 39 | inline std::string host_name() |
39 | 40 | { |
40 | 41 | char name[1024]; |
… |
… |
|
46 | 47 | } |
47 | 48 | return std::string(name); |
48 | 49 | } |
| 50 | #endif |
49 | 51 | |
50 | 52 | inline std::string host_name(boost::system::error_code& ec) |
51 | 53 | { |
-
diff -ur boost_1_36_0/boost/asio/ssl/basic_context.hpp boost_1_36_0_exceptions/boost/asio/ssl/basic_context.hpp
old
|
new
|
|
80 | 80 | * |
81 | 81 | * @throws boost::system::system_error Thrown on failure. |
82 | 82 | */ |
| 83 | #ifndef BOOST_NO_EXCEPTIONS |
83 | 84 | void set_options(options o) |
84 | 85 | { |
85 | 86 | boost::system::error_code ec; |
86 | 87 | service_.set_options(impl_, o, ec); |
87 | 88 | boost::asio::detail::throw_error(ec); |
88 | 89 | } |
| 90 | #endif |
89 | 91 | |
90 | 92 | /// Set options on the context. |
91 | 93 | /** |
… |
… |
|
113 | 115 | * |
114 | 116 | * @throws boost::system::system_error Thrown on failure. |
115 | 117 | */ |
| 118 | #ifndef BOOST_NO_EXCEPTIONS |
116 | 119 | void set_verify_mode(verify_mode v) |
117 | 120 | { |
118 | 121 | boost::system::error_code ec; |
119 | 122 | service_.set_verify_mode(impl_, v, ec); |
120 | 123 | boost::asio::detail::throw_error(ec); |
121 | 124 | } |
| 125 | #endif |
122 | 126 | |
123 | 127 | /// Set the peer verification mode. |
124 | 128 | /** |
… |
… |
|
146 | 150 | * |
147 | 151 | * @throws boost::system::system_error Thrown on failure. |
148 | 152 | */ |
| 153 | #ifndef BOOST_NO_EXCEPTIONS |
149 | 154 | void load_verify_file(const std::string& filename) |
150 | 155 | { |
151 | 156 | boost::system::error_code ec; |
152 | 157 | service_.load_verify_file(impl_, filename, ec); |
153 | 158 | boost::asio::detail::throw_error(ec); |
154 | 159 | } |
| 160 | #endif |
155 | 161 | |
156 | 162 | /// Load a certification authority file for performing verification. |
157 | 163 | /** |
… |
… |
|
181 | 187 | * |
182 | 188 | * @throws boost::system::system_error Thrown on failure. |
183 | 189 | */ |
| 190 | #ifndef BOOST_NO_EXCEPTIONS |
184 | 191 | void add_verify_path(const std::string& path) |
185 | 192 | { |
186 | 193 | boost::system::error_code ec; |
187 | 194 | service_.add_verify_path(impl_, path, ec); |
188 | 195 | boost::asio::detail::throw_error(ec); |
189 | 196 | } |
| 197 | #endif |
190 | 198 | |
191 | 199 | /// Add a directory containing certificate authority files to be used for |
192 | 200 | /// performing verification. |
… |
… |
|
216 | 224 | * |
217 | 225 | * @throws boost::system::system_error Thrown on failure. |
218 | 226 | */ |
| 227 | #ifndef BOOST_NO_EXCEPTIONS |
219 | 228 | void use_certificate_file(const std::string& filename, file_format format) |
220 | 229 | { |
221 | 230 | boost::system::error_code ec; |
222 | 231 | service_.use_certificate_file(impl_, filename, format, ec); |
223 | 232 | boost::asio::detail::throw_error(ec); |
224 | 233 | } |
| 234 | #endif |
225 | 235 | |
226 | 236 | /// Use a certificate from a file. |
227 | 237 | /** |
… |
… |
|
249 | 259 | * |
250 | 260 | * @throws boost::system::system_error Thrown on failure. |
251 | 261 | */ |
| 262 | #ifndef BOOST_NO_EXCEPTIONS |
252 | 263 | void use_certificate_chain_file(const std::string& filename) |
253 | 264 | { |
254 | 265 | boost::system::error_code ec; |
255 | 266 | service_.use_certificate_chain_file(impl_, filename, ec); |
256 | 267 | boost::asio::detail::throw_error(ec); |
257 | 268 | } |
| 269 | #endif |
258 | 270 | |
259 | 271 | /// Use a certificate chain from a file. |
260 | 272 | /** |
… |
… |
|
282 | 294 | * |
283 | 295 | * @throws boost::system::system_error Thrown on failure. |
284 | 296 | */ |
| 297 | #ifndef BOOST_NO_EXCEPTIONS |
285 | 298 | void use_private_key_file(const std::string& filename, file_format format) |
286 | 299 | { |
287 | 300 | boost::system::error_code ec; |
288 | 301 | service_.use_private_key_file(impl_, filename, format, ec); |
289 | 302 | boost::asio::detail::throw_error(ec); |
290 | 303 | } |
| 304 | #endif |
291 | 305 | |
292 | 306 | /// Use a private key from a file. |
293 | 307 | /** |
… |
… |
|
316 | 330 | * |
317 | 331 | * @throws boost::system::system_error Thrown on failure. |
318 | 332 | */ |
| 333 | #ifndef BOOST_NO_EXCEPTIONS |
319 | 334 | void use_rsa_private_key_file(const std::string& filename, file_format format) |
320 | 335 | { |
321 | 336 | boost::system::error_code ec; |
322 | 337 | service_.use_rsa_private_key_file(impl_, filename, format, ec); |
323 | 338 | boost::asio::detail::throw_error(ec); |
324 | 339 | } |
| 340 | #endif |
325 | 341 | |
326 | 342 | /// Use an RSA private key from a file. |
327 | 343 | /** |
… |
… |
|
351 | 367 | * |
352 | 368 | * @throws boost::system::system_error Thrown on failure. |
353 | 369 | */ |
| 370 | #ifndef BOOST_NO_EXCEPTIONS |
354 | 371 | void use_tmp_dh_file(const std::string& filename) |
355 | 372 | { |
356 | 373 | boost::system::error_code ec; |
357 | 374 | service_.use_tmp_dh_file(impl_, filename, ec); |
358 | 375 | boost::asio::detail::throw_error(ec); |
359 | 376 | } |
| 377 | #endif |
360 | 378 | |
361 | 379 | /// Use the specified file to obtain the temporary Diffie-Hellman parameters. |
362 | 380 | /** |
… |
… |
|
389 | 407 | * |
390 | 408 | * @throws boost::system::system_error Thrown on failure. |
391 | 409 | */ |
| 410 | #ifndef BOOST_NO_EXCEPTIONS |
392 | 411 | template <typename PasswordCallback> |
393 | 412 | void set_password_callback(PasswordCallback callback) |
394 | 413 | { |
… |
… |
|
396 | 415 | service_.set_password_callback(impl_, callback, ec); |
397 | 416 | boost::asio::detail::throw_error(ec); |
398 | 417 | } |
| 418 | #endif |
399 | 419 | |
400 | 420 | /// Set the password callback. |
401 | 421 | /** |
-
diff -ur boost_1_36_0/boost/asio/ssl/detail/openssl_stream_service.hpp boost_1_36_0_exceptions/boost/asio/ssl/detail/openssl_stream_service.hpp
old
|
new
|
|
214 | 214 | boost::system::error_code handshake(impl_type& impl, Stream& next_layer, |
215 | 215 | stream_base::handshake_type type, boost::system::error_code& ec) |
216 | 216 | { |
| 217 | #ifndef BOOST_NO_EXCEPTIONS |
217 | 218 | try |
218 | 219 | { |
| 220 | #endif |
219 | 221 | openssl_operation<Stream> op( |
220 | 222 | type == stream_base::client ? |
221 | 223 | &ssl_wrap<mutex_type>::SSL_connect: |
… |
… |
|
225 | 227 | impl->ssl, |
226 | 228 | impl->ext_bio); |
227 | 229 | op.start(); |
| 230 | #ifndef BOOST_NO_EXCEPTIONS |
228 | 231 | } |
229 | 232 | catch (boost::system::system_error& e) |
230 | 233 | { |
231 | 234 | ec = e.code(); |
232 | 235 | return ec; |
233 | 236 | } |
| 237 | #endif |
234 | 238 | |
235 | 239 | ec = boost::system::error_code(); |
236 | 240 | return ec; |
… |
… |
|
274 | 278 | boost::system::error_code shutdown(impl_type& impl, Stream& next_layer, |
275 | 279 | boost::system::error_code& ec) |
276 | 280 | { |
| 281 | #ifndef BOOST_NO_EXCEPTIONS |
277 | 282 | try |
278 | 283 | { |
| 284 | #endif |
279 | 285 | openssl_operation<Stream> op( |
280 | 286 | &ssl_wrap<mutex_type>::SSL_shutdown, |
281 | 287 | next_layer, |
… |
… |
|
283 | 289 | impl->ssl, |
284 | 290 | impl->ext_bio); |
285 | 291 | op.start(); |
| 292 | #ifndef BOOST_NO_EXCEPTIONS |
286 | 293 | } |
287 | 294 | catch (boost::system::system_error& e) |
288 | 295 | { |
289 | 296 | ec = e.code(); |
290 | 297 | return ec; |
291 | 298 | } |
| 299 | #endif |
292 | 300 | |
293 | 301 | ec = boost::system::error_code(); |
294 | 302 | return ec; |
… |
… |
|
330 | 338 | const Const_Buffers& buffers, boost::system::error_code& ec) |
331 | 339 | { |
332 | 340 | size_t bytes_transferred = 0; |
| 341 | #ifndef BOOST_NO_EXCEPTIONS |
333 | 342 | try |
334 | 343 | { |
| 344 | #endif |
335 | 345 | std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin()); |
336 | 346 | if (buffer_size > max_buffer_size) |
337 | 347 | buffer_size = max_buffer_size; |
… |
… |
|
348 | 358 | impl->ext_bio |
349 | 359 | ); |
350 | 360 | bytes_transferred = static_cast<size_t>(op.start()); |
| 361 | #ifndef BOOST_NO_EXCEPTIONS |
351 | 362 | } |
352 | 363 | catch (boost::system::system_error& e) |
353 | 364 | { |
354 | 365 | ec = e.code(); |
355 | 366 | return 0; |
356 | 367 | } |
| 368 | #endif |
357 | 369 | |
358 | 370 | ec = boost::system::error_code(); |
359 | 371 | return bytes_transferred; |
… |
… |
|
404 | 416 | const Mutable_Buffers& buffers, boost::system::error_code& ec) |
405 | 417 | { |
406 | 418 | size_t bytes_transferred = 0; |
| 419 | #ifndef BOOST_NO_EXCEPTIONS |
407 | 420 | try |
408 | 421 | { |
| 422 | #endif |
409 | 423 | std::size_t buffer_size = boost::asio::buffer_size(*buffers.begin()); |
410 | 424 | if (buffer_size > max_buffer_size) |
411 | 425 | buffer_size = max_buffer_size; |
… |
… |
|
422 | 436 | ); |
423 | 437 | |
424 | 438 | bytes_transferred = static_cast<size_t>(op.start()); |
| 439 | #ifndef BOOST_NO_EXCEPTIONS |
425 | 440 | } |
426 | 441 | catch (boost::system::system_error& e) |
427 | 442 | { |
428 | 443 | ec = e.code(); |
429 | 444 | return 0; |
430 | 445 | } |
| 446 | #endif |
431 | 447 | |
432 | 448 | ec = boost::system::error_code(); |
433 | 449 | return bytes_transferred; |
-
diff -ur boost_1_36_0/boost/asio/ssl/stream.hpp boost_1_36_0_exceptions/boost/asio/ssl/stream.hpp
old
|
new
|
|
171 | 171 | * |
172 | 172 | * @throws boost::system::system_error Thrown on failure. |
173 | 173 | */ |
| 174 | #ifndef BOOST_NO_EXCEPTIONS |
174 | 175 | void handshake(handshake_type type) |
175 | 176 | { |
176 | 177 | boost::system::error_code ec; |
177 | 178 | service_.handshake(impl_, next_layer_, type, ec); |
178 | 179 | boost::asio::detail::throw_error(ec); |
179 | 180 | } |
| 181 | #endif |
180 | 182 | |
181 | 183 | /// Perform SSL handshaking. |
182 | 184 | /** |
… |
… |
|
222 | 224 | * |
223 | 225 | * @throws boost::system::system_error Thrown on failure. |
224 | 226 | */ |
| 227 | #ifndef BOOST_NO_EXCEPTIONS |
225 | 228 | void shutdown() |
226 | 229 | { |
227 | 230 | boost::system::error_code ec; |
228 | 231 | service_.shutdown(impl_, next_layer_, ec); |
229 | 232 | boost::asio::detail::throw_error(ec); |
230 | 233 | } |
| 234 | #endif |
231 | 235 | |
232 | 236 | /// Shut down SSL on the stream. |
233 | 237 | /** |
… |
… |
|
275 | 279 | * peer. Consider using the @ref write function if you need to ensure that all |
276 | 280 | * data is written before the blocking operation completes. |
277 | 281 | */ |
| 282 | #ifndef BOOST_NO_EXCEPTIONS |
278 | 283 | template <typename ConstBufferSequence> |
279 | 284 | std::size_t write_some(const ConstBufferSequence& buffers) |
280 | 285 | { |
… |
… |
|
283 | 288 | boost::asio::detail::throw_error(ec); |
284 | 289 | return s; |
285 | 290 | } |
| 291 | #endif |
286 | 292 | |
287 | 293 | /// Write some data to the stream. |
288 | 294 | /** |
… |
… |
|
352 | 358 | * bytes. Consider using the @ref read function if you need to ensure that the |
353 | 359 | * requested amount of data is read before the blocking operation completes. |
354 | 360 | */ |
| 361 | #ifndef BOOST_NO_EXCEPTIONS |
355 | 362 | template <typename MutableBufferSequence> |
356 | 363 | std::size_t read_some(const MutableBufferSequence& buffers) |
357 | 364 | { |
… |
… |
|
360 | 367 | boost::asio::detail::throw_error(ec); |
361 | 368 | return s; |
362 | 369 | } |
| 370 | #endif |
363 | 371 | |
364 | 372 | /// Read some data from the stream. |
365 | 373 | /** |
… |
… |
|
426 | 434 | * |
427 | 435 | * @throws boost::system::system_error Thrown on failure. |
428 | 436 | */ |
| 437 | #ifndef BOOST_NO_EXCEPTIONS |
429 | 438 | template <typename MutableBufferSequence> |
430 | 439 | std::size_t peek(const MutableBufferSequence& buffers) |
431 | 440 | { |
… |
… |
|
434 | 443 | boost::asio::detail::throw_error(ec); |
435 | 444 | return s; |
436 | 445 | } |
| 446 | #endif |
437 | 447 | |
438 | 448 | /// Peek at the incoming data on the stream. |
439 | 449 | /** |
… |
… |
|
463 | 473 | * |
464 | 474 | * @throws boost::system::system_error Thrown on failure. |
465 | 475 | */ |
| 476 | #ifndef BOOST_NO_EXCEPTIONS |
466 | 477 | std::size_t in_avail() |
467 | 478 | { |
468 | 479 | boost::system::error_code ec; |
… |
… |
|
470 | 481 | boost::asio::detail::throw_error(ec); |
471 | 482 | return s; |
472 | 483 | } |
| 484 | #endif |
473 | 485 | |
474 | 486 | /// Determine the amount of data that may be read without blocking. |
475 | 487 | /** |