xtd 0.2.0
Loading...
Searching...
No Matches
network_stream.h
Go to the documentation of this file.
1
4#pragma once
5#include "socket.h"
6#include <iostream>
7
9namespace xtd {
11 namespace net {
13 namespace sockets {
35 class core_export_ network_stream : public std::iostream {
36 class socket_streambuf : public std::streambuf {
37 public:
38 socket_streambuf(const xtd::net::sockets::socket& socket, bool owns_socket);
39 ~socket_streambuf();
40
41 int32 underflow() override;
42 int32 overflow(int32 value) override;
43
45 bool owns_socket_ = false;
46 char value_ = EOF;
47 };
48
49 public:
51
57
64
66
73 virtual bool data_available() const;
74
80
81 private:
82 socket_streambuf stream_buf_;
83 };
84 }
85 }
86}
Provides the underlying stream of data for network access.
Definition network_stream.h:35
network_stream(const xtd::net::sockets::socket &socket)
Creates a new instance of the network_stream class for the specified xtd::net::sockets::socket.
network_stream(const xtd::net::sockets::socket &socket, bool owns_socket)
Initializes a new instance of the xtd::net::sockets::network_stream class for the specified xtd::net:...
xtd::net::sockets::socket socket() const
Gets the underlying xtd::net::sockets::socket.
virtual bool data_available() const
Gets a value that indicates whether data is available on the xtd::net::sockets::network_stream to be ...
Implements the Berkeley sockets interface.
Definition socket.h:71
#define core_export_
Define shared library export.
Definition core_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::net::sockets::socket class.