Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -51,41 +51,42 @@ class CPassiveSocket;
|
||||
/// An active socket is used to create a socket which connects to a server.
|
||||
/// This type of object would be used when an application needs to send/receive
|
||||
/// data from a server.
|
||||
class CActiveSocket : public CSimpleSocket {
|
||||
class CActiveSocket : public CSimpleSocket
|
||||
{
|
||||
public:
|
||||
friend class CPassiveSocket;
|
||||
friend class CPassiveSocket;
|
||||
|
||||
CActiveSocket(CSocketType type = SocketTypeTcp);
|
||||
virtual ~CActiveSocket() {
|
||||
Close();
|
||||
};
|
||||
CActiveSocket(CSocketType type = SocketTypeTcp);
|
||||
virtual ~CActiveSocket()
|
||||
{
|
||||
Close();
|
||||
};
|
||||
|
||||
/// Established a connection to the address specified by pAddr.
|
||||
/// Connection-based protocol sockets (CSocket::SocketTypeTcp) may
|
||||
/// successfully call Open() only once, however; connectionless protocol
|
||||
/// sockets (CSocket::SocketTypeUdp) may use Open() multiple times to
|
||||
/// change their association.
|
||||
/// @param pAddr specifies the destination address to connect.
|
||||
/// @param nPort specifies the destination port.
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
virtual bool Open(const char *pAddr, uint16 nPort);
|
||||
/// Established a connection to the address specified by pAddr.
|
||||
/// Connection-based protocol sockets (CSocket::SocketTypeTcp) may
|
||||
/// successfully call Open() only once, however; connectionless protocol
|
||||
/// sockets (CSocket::SocketTypeUdp) may use Open() multiple times to
|
||||
/// change their association.
|
||||
/// @param pAddr specifies the destination address to connect.
|
||||
/// @param nPort specifies the destination port.
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
virtual bool Open(const char *pAddr, uint16 nPort);
|
||||
|
||||
private:
|
||||
/// Utility function used to create a TCP connection, called from Open().
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
bool ConnectTCP(const char *pAddr, uint16 nPort);
|
||||
/// Utility function used to create a TCP connection, called from Open().
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
bool ConnectTCP(const char *pAddr, uint16 nPort);
|
||||
|
||||
/// Utility function used to create a UDP connection, called from Open().
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
bool ConnectUDP(const char *pAddr, uint16 nPort);
|
||||
/// Utility function used to create a UDP connection, called from Open().
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
bool ConnectUDP(const char *pAddr, uint16 nPort);
|
||||
|
||||
/// Utility function used to create a RAW connection, called from Open().
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
bool ConnectRAW(const char *pAddr, uint16 nPort);
|
||||
/// Utility function used to create a RAW connection, called from Open().
|
||||
/// @return true if successful connection made, otherwise false.
|
||||
bool ConnectRAW(const char *pAddr, uint16 nPort);
|
||||
|
||||
private:
|
||||
struct hostent *m_pHE;
|
||||
struct hostent *m_pHE;
|
||||
};
|
||||
|
||||
#endif /* __ACTIVESOCKET_H__ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user