xtd - Reference Guide
0.2.0
xtd.core
include
xtd
net
sockets
network_stream.h
Go to the documentation of this file.
1
#pragma once
5
6
#include <iostream>
7
#include "
socket.h
"
8
10
namespace
xtd
{
12
namespace
net {
14
namespace
sockets {
34
class
core_export_
network_stream
:
public
std::iostream {
35
class
socket_streambuf :
public
std::streambuf {
36
public
:
37
socket_streambuf(
const
xtd::net::sockets::socket
&
socket
,
bool
owns_socket);
38
~socket_streambuf();
39
40
int
underflow()
override
;
41
int
overflow(
int
value)
override
;
42
43
xtd::net::sockets::socket
socket_;
44
bool
owns_socket_ =
false
;
45
char
value_ = EOF;
46
};
47
48
public
:
50
55
explicit
network_stream
(
const
xtd::net::sockets::socket
&
socket
);
56
61
network_stream
(
const
xtd::net::sockets::socket
& socket,
bool
owns_socket);
63
65
72
virtual
bool
data_available()
const
;
73
77
xtd::net::sockets::socket
socket
()
const
;
79
80
private
:
81
socket_streambuf stream_buf_;
82
};
83
}
84
}
85
}
xtd::net::sockets::socket
Implements the Berkeley sockets interface.
Definition:
socket.h:68
xtd::net::sockets::network_stream
Provides the underlying stream of data for network access.
Definition:
network_stream.h:34
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition:
system_report.h:17
xtd::net::sockets::socket_option_level::socket
Socket options apply to all sockets.
socket.h
Contains xtd::net::sockets::socket class.
Generated on Fri Aug 19 2022 22:20:32 for xtd - Reference Guide by
Gammasoft
. All rights reserved.