aboutsummaryrefslogtreecommitdiff
path: root/dep/include/sockets/StreamSocket.h
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 15:35:07 -0700
committermaximius <none@none>2009-10-17 15:35:07 -0700
commit26b5e033ffde3d161382fc9addbfa99738379641 (patch)
treea344f369ca32945f787a02dee35c3dbe342bed7e /dep/include/sockets/StreamSocket.h
parentf21f47005dcb6b76e1abc9f35fbcd03eed191bff (diff)
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
Diffstat (limited to 'dep/include/sockets/StreamSocket.h')
-rw-r--r--dep/include/sockets/StreamSocket.h32
1 files changed, 0 insertions, 32 deletions
diff --git a/dep/include/sockets/StreamSocket.h b/dep/include/sockets/StreamSocket.h
index e839040e2b0..6abb936b6cd 100644
--- a/dep/include/sockets/StreamSocket.h
+++ b/dep/include/sockets/StreamSocket.h
@@ -1,14 +1,11 @@
#ifndef _StreamSocket_H
#define _StreamSocket_H
-
#include "Socket.h"
-
#ifdef SOCKETS_NAMESPACE
namespace SOCKETS_NAMESPACE {
#endif
-
/** SOCK_STREAM Socket base class.
\ingroup basic */
class StreamSocket : public Socket
@@ -16,96 +13,70 @@ class StreamSocket : public Socket
public:
StreamSocket(ISocketHandler& );
~StreamSocket();
-
/** Socket should Check Connect on next write event from select(). */
void SetConnecting(bool = true);
-
/** Check connecting flag.
\return true if the socket is still trying to connect */
bool Connecting();
-
/** Returns true when socket file descriptor is valid,
socket connection is established, and socket is not about to
be closed. */
bool Ready();
-
/** Set timeout to use for connection attempt.
\param x Timeout in seconds */
void SetConnectTimeout(int x);
-
/** Return number of seconds to wait for a connection.
\return Connection timeout (seconds) */
int GetConnectTimeout();
-
/** Set flush before close to make a tcp socket completely empty its
output buffer before closing the connection. */
void SetFlushBeforeClose(bool = true);
-
/** Check flush before status.
\return true if the socket should send all data before closing */
bool GetFlushBeforeClose();
-
/** Define number of connection retries (tcp only).
n = 0 - no retry
n > 0 - number of retries
n = -1 - unlimited retries */
void SetConnectionRetry(int n);
-
/** Get number of maximum connection retries (tcp only). */
int GetConnectionRetry();
-
/** Increase number of actual connection retries (tcp only). */
void IncreaseConnectionRetries();
-
/** Get number of actual connection retries (tcp only). */
int GetConnectionRetries();
-
/** Reset actual connection retries (tcp only). */
void ResetConnectionRetries();
-
// LIST_CALLONCONNECT
-
/** Instruct socket to call OnConnect callback next sockethandler cycle. */
void SetCallOnConnect(bool x = true);
-
/** Check call on connect flag.
\return true if OnConnect() should be called a.s.a.p */
bool CallOnConnect();
-
// LIST_RETRY
-
/** Set flag to initiate a connection attempt after a connection timeout. */
void SetRetryClientConnect(bool x = true);
-
/** Check if a connection attempt should be made.
\return true when another attempt should be made */
bool RetryClientConnect();
-
/** Called after OnRead if socket is in line protocol mode.
\sa SetLineProtocol */
/** Enable the OnLine callback. Do not create your own OnRead
* callback when using this. */
virtual void SetLineProtocol(bool = true);
-
/** Check line protocol mode.
\return true if socket is in line protocol mode */
bool LineProtocol();
-
/** Set shutdown status. */
void SetShutdown(int);
-
/** Get shutdown status. */
int GetShutdown();
-
/** Returns IPPROTO_TCP or IPPROTO_SCTP */
virtual int Protocol() = 0;
-
protected:
StreamSocket(const StreamSocket& ) {} // copy constructor
-
private:
StreamSocket& operator=(const StreamSocket& ) { return *this; } // assignment operator
-
bool m_bConnecting; ///< Flag indicating connection in progress
int m_connect_timeout; ///< Connection timeout (seconds)
bool m_flush_before_close; ///< Send all data before closing (default true)
@@ -117,12 +88,9 @@ private:
int m_shutdown; ///< Shutdown status
};
-
#ifdef SOCKETS_NAMESPACE
} // namespace SOCKETS_NAMESPACE {
#endif
-
#endif // _StreamSocket_H
-