summaryrefslogtreecommitdiff
path: root/include/SFML/Network/TcpSocket.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/SFML/Network/TcpSocket.hpp')
-rw-r--r--include/SFML/Network/TcpSocket.hpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/SFML/Network/TcpSocket.hpp b/include/SFML/Network/TcpSocket.hpp
index 03a69ec..a402506 100644
--- a/include/SFML/Network/TcpSocket.hpp
+++ b/include/SFML/Network/TcpSocket.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2014 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -124,6 +124,9 @@ public:
////////////////////////////////////////////////////////////
/// \brief Send raw data to the remote peer
///
+ /// To be able to handle partial sends over non-blocking
+ /// sockets, use the send(const void*, std::size_t, std::size_t&)
+ /// overload instead.
/// This function will fail if the socket is not connected.
///
/// \param data Pointer to the sequence of bytes to send
@@ -137,6 +140,22 @@ public:
Status send(const void* data, std::size_t size);
////////////////////////////////////////////////////////////
+ /// \brief Send raw data to the remote peer
+ ///
+ /// This function will fail if the socket is not connected.
+ ///
+ /// \param data Pointer to the sequence of bytes to send
+ /// \param size Number of bytes to send
+ /// \param sent The number of bytes sent will be written here
+ ///
+ /// \return Status code
+ ///
+ /// \see receive
+ ///
+ ////////////////////////////////////////////////////////////
+ Status send(const void* data, std::size_t size, std::size_t& sent);
+
+ ////////////////////////////////////////////////////////////
/// \brief Receive raw data from the remote peer
///
/// In blocking mode, this function will wait until some
@@ -157,6 +176,10 @@ public:
////////////////////////////////////////////////////////////
/// \brief Send a formatted packet of data to the remote peer
///
+ /// In non-blocking mode, if this function returns sf::Socket::Partial,
+ /// you \em must retry sending the same unmodified packet before sending
+ /// anything else in order to guarantee the packet arrives at the remote
+ /// peer uncorrupted.
/// This function will fail if the socket is not connected.
///
/// \param packet Packet to send