summaryrefslogtreecommitdiff
path: root/src/PassiveSocket.h
diff options
context:
space:
mode:
authorPetr Mrázek2012-03-11 16:00:38 +0100
committerPetr Mrázek2012-03-11 16:00:38 +0100
commit9f3026df545efeccb9bf33fe56f47bdee4c06e4a (patch)
treef01ed18171054d77ce41bd9fa827806561458025 /src/PassiveSocket.h
parentf8a2b0977253079b66d4ec14d5fceaa8458d11d6 (diff)
downloadclsocket-9f3026df545efeccb9bf33fe56f47bdee4c06e4a.tar.gz
clsocket-9f3026df545efeccb9bf33fe56f47bdee4c06e4a.tar.bz2
clsocket-9f3026df545efeccb9bf33fe56f47bdee4c06e4a.tar.xz
Unify whitespace and formatting
Diffstat (limited to 'src/PassiveSocket.h')
-rw-r--r--src/PassiveSocket.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/PassiveSocket.h b/src/PassiveSocket.h
index b26f284..163d369 100644
--- a/src/PassiveSocket.h
+++ b/src/PassiveSocket.h
@@ -46,51 +46,53 @@
/// Provides a platform independent class to create a passive socket.
/// A passive socket is used to create a "listening" socket. This type
-/// of object would be used when an application needs to wait for
-/// inbound connections. Support for CSimpleSocket::SocketTypeTcp,
+/// of object would be used when an application needs to wait for
+/// inbound connections. Support for CSimpleSocket::SocketTypeTcp,
/// CSimpleSocket::SocketTypeUdp, and CSimpleSocket::SocketTypeRaw is handled
-/// in a similar fashion. The big difference is that the method
+/// in a similar fashion. The big difference is that the method
/// CPassiveSocket::Accept should not be called on the latter two socket
-/// types.
+/// types.
class CPassiveSocket : public CSimpleSocket {
public:
CPassiveSocket(CSocketType type = SocketTypeTcp);
- virtual ~CPassiveSocket() { Close(); };
+ virtual ~CPassiveSocket() {
+ Close();
+ };
- /// Extracts the first connection request on the queue of pending
- /// connections and creates a newly connected socket. Used with
+ /// Extracts the first connection request on the queue of pending
+ /// connections and creates a newly connected socket. Used with
/// CSocketType CSimpleSocket::SocketTypeTcp. It is the responsibility of
/// the caller to delete the returned object when finished.
/// @return if successful a pointer to a newly created CActiveSocket object
- /// will be returned and the internal error condition of the CPassiveSocket
+ /// will be returned and the internal error condition of the CPassiveSocket
/// object will be CPassiveSocket::SocketSuccess. If an error condition was encountered
/// the NULL will be returned and one of the following error conditions will be set:
- /// CPassiveSocket::SocketEwouldblock, CPassiveSocket::SocketInvalidSocket,
+ /// CPassiveSocket::SocketEwouldblock, CPassiveSocket::SocketInvalidSocket,
/// CPassiveSocket::SocketConnectionAborted, CPassiveSocket::SocketInterrupted
/// CPassiveSocket::SocketProtocolError, CPassiveSocket::SocketFirewallError
virtual CActiveSocket *Accept(void);
/// Bind to a multicast group on a specified interface, multicast group, and port
- ///
+ ///
/// @param pInterface - interface on which to bind.
/// @param pGroup - multicast group address to bind.
- /// @param nPort - port on which multicast
+ /// @param nPort - port on which multicast
/// @return true if able to bind to interface and multicast group.
/// If not successful, the false is returned and one of the following error
- /// condiitions will be set: CPassiveSocket::SocketAddressInUse, CPassiveSocket::SocketProtocolError,
+ /// condiitions will be set: CPassiveSocket::SocketAddressInUse, CPassiveSocket::SocketProtocolError,
/// CPassiveSocket::SocketInvalidSocket. The following socket errors are for Linux/Unix
/// derived systems only: CPassiveSocket::SocketInvalidSocketBuffer
bool BindMulticast(const uint8 *pInterface, const uint8 *pGroup, int16 nPort);
/// Create a listening socket at local ip address 'x.x.x.x' or 'localhost'
/// if pAddr is NULL on port nPort.
- ///
+ ///
/// @param pAddr specifies the IP address on which to listen.
/// @param nPort specifies the port on which to listen.
/// @param nConnectionBacklog specifies connection queue backlog (default 30,000)
- /// @return true if a listening socket was created.
+ /// @return true if a listening socket was created.
/// If not successful, the false is returned and one of the following error
- /// condiitions will be set: CPassiveSocket::SocketAddressInUse, CPassiveSocket::SocketProtocolError,
+ /// condiitions will be set: CPassiveSocket::SocketAddressInUse, CPassiveSocket::SocketProtocolError,
/// CPassiveSocket::SocketInvalidSocket. The following socket errors are for Linux/Unix
/// derived systems only: CPassiveSocket::SocketInvalidSocketBuffer
virtual bool Listen(const uint8 *pAddr, int16 nPort, int32 nConnectionBacklog = 30000);
@@ -102,14 +104,14 @@ public:
/// connection has been shutdown on the other side, and a return of -1
/// means that an error has occurred. If an error was signaled then one
/// of the following error codes will be set: CPassiveSocket::SocketInvalidSocket,
- /// CPassiveSocket::SocketEwouldblock, SimpleSocket::SocketConnectionReset,
- /// CPassiveSocket::SocketInvalidSocketBuffer, CPassiveSocket::SocketInterrupted,
+ /// CPassiveSocket::SocketEwouldblock, SimpleSocket::SocketConnectionReset,
+ /// CPassiveSocket::SocketInvalidSocketBuffer, CPassiveSocket::SocketInterrupted,
/// CPassiveSocket::SocketProtocolError, CPassiveSocket::SocketNotconnected
- /// <br>\b Note: This function is used only for a socket of type
- /// CSimpleSocket::SocketTypeUdp
+ /// <br>\b Note: This function is used only for a socket of type
+ /// CSimpleSocket::SocketTypeUdp
virtual int32 Send(const uint8 *pBuf, size_t bytesToSend);
- private:
+private:
struct ip_mreq m_stMulticastRequest; /// group address for multicast
};