25 #ifndef CPP3DS_TCPSOCKET_HPP
26 #define CPP3DS_TCPSOCKET_HPP
31 #include <cpp3ds/Network/Socket.hpp>
32 #include <cpp3ds/System/Time.hpp>
139 Status send(
const void* data, std::size_t size);
155 Status send(
const void* data, std::size_t size, std::size_t& sent);
173 Status receive(
void* data, std::size_t size, std::size_t& received);
222 std::size_t SizeReceived;
223 std::vector<char> Data;
229 PendingPacket m_pendingPacket;
235 #endif // CPP3DS_TCPSOCKET_HPP
Encapsulate an IPv4 network address.
unsigned short getLocalPort() const
Get the port to which the socket is bound locally.
Utility class to build blocks of data to transfer over the network.
Base class for all the socket types.
void disconnect()
Disconnect the socket from its remote peer.
TcpSocket()
Default constructor.
Status send(const void *data, std::size_t size)
Send raw data to the remote peer.
Status connect(const IpAddress &remoteAddress, unsigned short remotePort, Time timeout=Time::Zero)
Connect the socket to a remote peer.
Status receive(void *data, std::size_t size, std::size_t &received)
Receive raw data from the remote peer.
unsigned short getRemotePort() const
Get the port of the connected peer to which the socket is connected.
IpAddress getRemoteAddress() const
Get the address of the connected peer.
Specialized socket using the TCP protocol.
Status
Status codes that may be returned by socket functions.
Socket that listens to new TCP connections.
static const Time Zero
Predefined "zero" time value.