32 lines
551 B
C++
32 lines
551 B
C++
#include <socket/intsaddr.hpp>
|
|
#include <ftp/ftpdata.hpp>
|
|
|
|
FTPData::FTPData(void)
|
|
{
|
|
create();
|
|
}
|
|
|
|
FTPData::~FTPData()
|
|
{
|
|
destroy();
|
|
}
|
|
|
|
WORD FTPData::accept(void)
|
|
{
|
|
if(!mFTPDataSocket.isListening())return FALSE;
|
|
if(!mFTPDataSocket.accept((Socket&)*this))return FALSE;
|
|
mFTPDataSocket.destroy();
|
|
return TRUE;
|
|
}
|
|
|
|
void FTPData::create(void)
|
|
{
|
|
destroy();
|
|
if(!mWSASystem.isInitialized())return;
|
|
if(!mFTPDataSocket.create())return;
|
|
family(AF_INET);
|
|
if(!mFTPDataSocket.bind((INETSocketAddress&)*this))return;
|
|
if(!mFTPDataSocket.listen())return;
|
|
}
|
|
|