2
* Copyright (C) 2004-2010 See the AUTHORS file for details.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 as published
6
* by the Free Software Foundation.
14
// Forward Declarations
16
// !Forward Declarations
26
CListener(unsigned short uPort, const CString& sBindHost, bool bSSL, EAddrType eAddr, EAcceptType eAccept) {
28
m_sBindHost = sBindHost;
32
m_eAcceptType = eAccept;
38
bool IsSSL() const { return m_bSSL; }
39
EAddrType GetAddrType() const { return m_eAddr; }
40
unsigned short GetPort() const { return m_uPort; }
41
const CString& GetBindHost() const { return m_sBindHost; }
42
CRealListener* GetRealListener() const { return m_pListener; }
43
EAcceptType GetAcceptType() const { return m_eAcceptType; }
46
// It doesn't make sense to change any of the settings after Listen()
47
// except this one, so don't add other setters!
48
void SetAcceptType(EAcceptType eType) { m_eAcceptType = eType; }
51
void ResetRealListener();
57
unsigned short m_uPort;
59
CRealListener* m_pListener;
60
EAcceptType m_eAcceptType;
63
class CRealListener : public CZNCSock {
65
CRealListener(CListener *pParent) : CZNCSock(), m_pParent(pParent) {}
66
virtual ~CRealListener();
68
virtual bool ConnectionFrom(const CString& sHost, unsigned short uPort);
69
virtual Csock* GetSockObj(const CString& sHost, unsigned short uPort);
70
virtual void SockError(int iErrno);
76
class CIncomingConnection : public CZNCSock {
78
CIncomingConnection(const CString& sHostname, unsigned short uPort, CListener::EAcceptType eAcceptType);
79
virtual ~CIncomingConnection() {}
80
virtual void ReadLine(const CString& sData);
83
CListener::EAcceptType m_eAcceptType;
86
#endif // !_LISTENER_H