Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
stdtcpclientconnection.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
25
#include "
core/refcounted.h
"
26
#include "
net/socket/ipaddress.h
"
27
#include "
io/stream.h
"
28
#include "
net/socket/socket.h
"
29
30
//------------------------------------------------------------------------------
31
namespace
Net
32
{
33
class
StdTcpClientConnection
:
public
Core::RefCounted
34
{
35
__DeclareClass
(
StdTcpClientConnection
);
36
public
:
38
StdTcpClientConnection
();
40
virtual
~StdTcpClientConnection
();
42
virtual
bool
Connect
(
const
Ptr<Socket>
& s);
44
bool
IsConnected
()
const
;
46
virtual
void
Shutdown
();
48
const
IpAddress
&
GetClientAddress
()
const
;
50
virtual
Socket::Result
Send
();
52
virtual
Socket::Result
Send
(
const
Ptr<IO::Stream>
& stream);
54
virtual
const
Ptr<IO::Stream>
&
GetSendStream
();
56
virtual
Socket::Result
Recv
();
58
virtual
const
Ptr<IO::Stream>
&
GetRecvStream
();
59
60
protected
:
61
Ptr<Socket>
socket
;
62
Ptr<IO::Stream>
sendStream
;
63
Ptr<IO::Stream>
recvStream
;
64
};
65
66
}
// namespace Net
67
//------------------------------------------------------------------------------
Core::RefCounted
The common base class of Nebula.
Definition
refcounted.h:38
IpAddress
Represents an IP address, consisting of a IPv4 host address and a port number.
Net::StdTcpClientConnection::sendStream
Ptr< IO::Stream > sendStream
Definition
stdtcpclientconnection.h:62
Net::StdTcpClientConnection::GetClientAddress
const IpAddress & GetClientAddress() const
get the client's ip address
Definition
stdtcpclientconnection.cc:93
Net::StdTcpClientConnection::StdTcpClientConnection
StdTcpClientConnection()
constructor
Definition
stdtcpclientconnection.cc:20
Net::StdTcpClientConnection::Send
virtual Socket::Result Send()
send accumulated content of send stream to server
Definition
stdtcpclientconnection.cc:146
Net::StdTcpClientConnection::~StdTcpClientConnection
virtual ~StdTcpClientConnection()
destructor
Definition
stdtcpclientconnection.cc:28
Net::StdTcpClientConnection::Connect
virtual bool Connect(const Ptr< Socket > &s)
connect using provided socket
Definition
stdtcpclientconnection.cc:37
Net::StdTcpClientConnection::GetRecvStream
virtual const Ptr< IO::Stream > & GetRecvStream()
access to recv stream
Definition
stdtcpclientconnection.cc:211
Net::StdTcpClientConnection::__DeclareClass
__DeclareClass(StdTcpClientConnection)
Net::StdTcpClientConnection::Recv
virtual Socket::Result Recv()
receive data from server into recv stream
Definition
stdtcpclientconnection.cc:158
Net::StdTcpClientConnection::GetSendStream
virtual const Ptr< IO::Stream > & GetSendStream()
access to send stream
Definition
stdtcpclientconnection.cc:202
Net::StdTcpClientConnection::Shutdown
virtual void Shutdown()
shutdown the connection
Definition
stdtcpclientconnection.cc:78
Net::StdTcpClientConnection::socket
Ptr< Socket > socket
Definition
stdtcpclientconnection.h:61
Net::StdTcpClientConnection::recvStream
Ptr< IO::Stream > recvStream
Definition
stdtcpclientconnection.h:63
Net::StdTcpClientConnection::IsConnected
bool IsConnected() const
get the connection status
Definition
stdtcpclientconnection.cc:62
Ptr
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition
ptr.h:38
ipaddress.h
Net
Definition
debugmessage.h:20
refcounted.h
socket.h
stream.h
code
foundation
net
tcp
stdtcpclientconnection.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.