c75d4c35f7
Ricompilazione Demo : [ ] Commento : Riportata la versione 3.1 patch 855 git-svn-id: svn://10.65.10.50/trunk@15071 c028cbd2-c16b-5b4b-a496-9718f37d4682
74 lines
2.0 KiB
C++
Executable File
74 lines
2.0 KiB
C++
Executable File
#ifndef __NETSOCK_H__
|
|
#define __NETSOCK_H__
|
|
|
|
#ifndef __NETUTILS_H__
|
|
#include "netutils.h"
|
|
#endif
|
|
|
|
class TSocketServer : public TLanServer
|
|
{
|
|
byte* m_pData;
|
|
unsigned int m_dwSize;
|
|
|
|
protected: // TLanManager
|
|
virtual bool Boot();
|
|
virtual bool ShutDown();
|
|
|
|
virtual bool OnRemoveConnection(CONNID id);
|
|
|
|
public:
|
|
byte* GetBuffer(size_t dwSize);
|
|
const byte* GetData() const { return m_pData; }
|
|
|
|
bool OnConnect(const TString& topic);
|
|
void OnConnectConfirm(CONNID id);
|
|
|
|
public:
|
|
virtual bool IsOk() const;
|
|
|
|
TSocketServer(const char* name);
|
|
virtual ~TSocketServer();
|
|
};
|
|
|
|
class TSocketClient : public TLanClient
|
|
{
|
|
byte* m_pData;
|
|
size_t m_dwSize;
|
|
|
|
protected: // TLanClient
|
|
virtual TConnection* OnQueryConnection(const char* service, const char* server);
|
|
int HttpGetHeader(CONNID id, const char* remote, const char* authorization, TString_array& header);
|
|
|
|
public:
|
|
virtual bool Request(CONNID id, const char* cmd);
|
|
virtual byte* GetBuffer(size_t& dwSize);
|
|
virtual void ReleaseBuffer();
|
|
virtual bool IsOk() const { return TRUE; }
|
|
|
|
bool WriteLine(CONNID id, const char* str);
|
|
bool ReadLine(CONNID id, TString& str);
|
|
|
|
bool HttpIsRedirectedServer(CONNID id, TString & http_server, TFilename & remote, const char* authorization = NULL);
|
|
bool HttpGetFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL);
|
|
bool HttpGetDir(CONNID id, const char* remote, TString_array& list);
|
|
bool HttpSoap(CONNID id, const char* query);
|
|
bool HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL);
|
|
|
|
TSocketClient();
|
|
virtual ~TSocketClient();
|
|
};
|
|
|
|
class TDDEClient : public TLanClient
|
|
{
|
|
protected:
|
|
virtual TConnection* OnQueryConnection(const char* service, const char* server);
|
|
virtual bool OnRemoveConnection(CONNID id);
|
|
virtual byte* GetBuffer(unsigned int& dwSize);
|
|
virtual void ReleaseBuffer();
|
|
|
|
public:
|
|
virtual bool Execute(CONNID id, const char* cmd);
|
|
};
|
|
|
|
#endif
|