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 {
37 class core_export_ network_stream : public std::iostream {
38 class socket_streambuf : public std::streambuf {
39 public:
40 socket_streambuf(const xtd::net::sockets::socket& socket, bool owns_socket);
41 ~socket_streambuf();
42
43 int32 underflow() override;
44 int32 overflow(int32 value) override;
45
47 bool owns_socket_ = false;
48 char value_ = EOF;
49 };
50
51 public:
53
59
66
68
75 virtual bool data_available() const;
76
82
83 private:
84 socket_streambuf stream_buf_;
85 };
86 }
87 }
88}
Provides the underlying stream of data for network access.
Definition network_stream.h:37
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:74
#define core_export_
Define shared library export.
Definition core_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::net::sockets::socket class.