mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
bring Csocket up to date, includes new needed function GetSockByFD()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@332 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "Modules.h"
|
||||
#include "Chan.h"
|
||||
#include "FileUtils.h"
|
||||
#include "Csocket.h"
|
||||
|
||||
// perl stuff
|
||||
#include <EXTERN.h>
|
||||
@@ -103,6 +104,44 @@ typedef vector< PString > VPString;
|
||||
class CModPerl;
|
||||
static CModPerl *g_ModPerl = NULL;
|
||||
|
||||
class CPerlSock : public Csock
|
||||
{
|
||||
public:
|
||||
CPerlSock() : Csock()
|
||||
{
|
||||
m_pModule = NULL;
|
||||
}
|
||||
CPerlSock( const CS_STRING & sHost, int iPort, int iTimeout = 60 )
|
||||
: Csock( sHost, iPort, iTimeout )
|
||||
{
|
||||
m_pModule = NULL;
|
||||
}
|
||||
|
||||
virtual Csock *GetSockObj( const CS_STRING & sHostname, int iPort )
|
||||
{
|
||||
CPerlSock *p = new CPerlSock( sHostname, iPort );
|
||||
p->SetModule( m_pModule );
|
||||
return( p );
|
||||
}
|
||||
|
||||
void SetModule( CModPerl *pModule ) { m_pModule = pModule; }
|
||||
|
||||
//
|
||||
// # OnConnect( $sockhandle, $parentsockhandle )
|
||||
// # OnConnectionFrom( $sockhandle, $remotehost, $remoteport )
|
||||
// # OnError( $sockhandle, $errno )
|
||||
// # OnConnectionRefused( $sockhandle )
|
||||
// # OnTimeout( $sockhandle )
|
||||
// # OnDisconnect( $sockhandle )
|
||||
// # OnData( $sockhandle, $bytes, $length )
|
||||
// # OnReadLine( $sockhandle, $bytes, $length )
|
||||
|
||||
private:
|
||||
CModPerl *m_pModule;
|
||||
CString m_sModuleName;
|
||||
CString m_sUsername; // NEED these so we can send the signal to the right guy
|
||||
};
|
||||
|
||||
class CPerlTimer : public CTimer
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user