summaryrefslogtreecommitdiff
path: root/include/SFML/Network/SocketTCP.hpp
diff options
context:
space:
mode:
authorChristoph Egger <Christoph.Egger@gmx.de>2008-11-01 17:37:58 +0100
committerChristoph Egger <Christoph.Egger@gmx.de>2008-11-01 17:37:58 +0100
commit9035708f4c5f7a78d8fb810e87e183fd61fd3350 (patch)
tree030e13b45c9882b799f793aa27007c74862fe934 /include/SFML/Network/SocketTCP.hpp
parenta96b4da2ed67a3e8dcc8e2a0d9af9463a23bb021 (diff)
Imported Upstream version 1.4~svn915
Diffstat (limited to 'include/SFML/Network/SocketTCP.hpp')
-rw-r--r--[-rwxr-xr-x]include/SFML/Network/SocketTCP.hpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/include/SFML/Network/SocketTCP.hpp b/include/SFML/Network/SocketTCP.hpp
index 06bcf9e..452b304 100755..100644
--- a/include/SFML/Network/SocketTCP.hpp
+++ b/include/SFML/Network/SocketTCP.hpp
@@ -29,12 +29,12 @@
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Network/SocketHelper.hpp>
-#include <SFML/Network/Packet.hpp>
-#include <cstddef>
+#include <vector>
namespace sf
{
+class Packet;
class IPAddress;
template <typename> class Selector;
@@ -66,11 +66,12 @@ public :
///
/// \param Port : Port to use for transfers (warning : ports < 1024 are reserved)
/// \param HostAddress : IP Address of the host to connect to
+ /// \param Timeout : Maximum time to wait, in seconds (0 by default : no timeout) (this parameter is ignored for non-blocking sockets)
///
/// \return True if operation has been successful
///
////////////////////////////////////////////////////////////
- bool Connect(unsigned short Port, const IPAddress& HostAddress);
+ Socket::Status Connect(unsigned short Port, const IPAddress& HostAddress, float Timeout = 0.f);
////////////////////////////////////////////////////////////
/// Listen to a specified port for incoming data or connections
@@ -204,15 +205,18 @@ private :
////////////////////////////////////////////////////////////
/// Create the socket
///
+ /// \param Descriptor : System socket descriptor to use (0 by default -- create a new socket)
+ ///
////////////////////////////////////////////////////////////
- void Create();
+ void Create(SocketHelper::SocketType Descriptor = 0);
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
SocketHelper::SocketType mySocket; ///< Socket descriptor
- sf::Packet myPendingPacket; ///< Current pending packet, if any (in non-blocking mode)
+ std::vector<char> myPendingPacket; ///< Data of the current pending packet, if any (in non-blocking mode)
Int32 myPendingPacketSize; ///< Size of the current pending packet, if any (in non-blocking mode)
+ bool myIsBlocking; ///< Is the socket blocking or non-blocking ?
};
} // namespace sf