@addtogroup libsocketplusplus * @{ */ * @brief Generic socket for active stream sockets (TCP client sockets, UNIX * Stream clients) * * This class defines the basic i/o operations for all stream-based sockets. */
| 50 | * This class defines the basic i/o operations for all stream-based sockets. |
| 51 | */ |
| 52 | class stream_client_socket : public virtual socket { |
| 53 | protected: |
| 54 | bool shut_rd; ///< If the socket was shut down for reading (-> no reads |
| 55 | ///< anymore) |
| 56 | bool shut_wr; ///< If the socket was shut down for writing (-> no writes |
| 57 | ///< anymore) |
| 58 | |
| 59 | public: |
| 60 | stream_client_socket(); |
| 61 | stream_client_socket(const stream_client_socket&) = delete; |
| 62 | stream_client_socket(stream_client_socket&& other) |
| 63 | : socket(std::move(other)), shut_rd(false), shut_wr(false) {} |
| 64 | |
| 65 | ssize_t snd(const void* buf, size_t len, int flags = 0); // flags: send() |
| 66 | ssize_t rcv(void* buf, size_t len, int flags = 0); // flags: recv() |
| 67 | |
| 68 | friend stream_client_socket& operator<<(stream_client_socket& sock, |
| 69 | const char* str); |
| 70 | friend stream_client_socket& operator<<(stream_client_socket& sock, |
| 71 | const string& str); |
| 72 | friend stream_client_socket& operator>>(stream_client_socket& sock, |
| 73 | string& dest); |
| 74 | friend class dgram_over_stream; |
| 75 | |
| 76 | void shutdown(int method = LIBSOCKET_WRITE); |
| 77 | }; |
| 78 | /** |
| 79 | * @} |
| 80 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected