1997-06-03 13:56:29 +00:00
|
|
|
#ifndef __NETSOCK_H__
|
|
|
|
#define __NETSOCK_H__
|
|
|
|
|
|
|
|
#ifndef __NETUTILS_H__
|
2004-03-12 16:01:27 +00:00
|
|
|
#include "netutils.h"
|
1997-06-03 13:56:29 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
class TSocketServer : public TLanServer
|
|
|
|
{
|
2002-09-13 14:56:23 +00:00
|
|
|
byte* m_pData;
|
|
|
|
unsigned int m_dwSize;
|
1997-06-03 13:56:29 +00:00
|
|
|
|
|
|
|
protected: // TLanManager
|
2002-09-13 14:56:23 +00:00
|
|
|
virtual bool Boot();
|
|
|
|
virtual bool ShutDown();
|
1997-06-03 13:56:29 +00:00
|
|
|
|
2002-09-13 14:56:23 +00:00
|
|
|
virtual bool OnRemoveConnection(CONNID id);
|
1997-06-03 13:56:29 +00:00
|
|
|
|
|
|
|
public:
|
2002-09-13 14:56:23 +00:00
|
|
|
byte* GetBuffer(size_t dwSize);
|
|
|
|
const byte* GetData() const { return m_pData; }
|
1997-06-03 13:56:29 +00:00
|
|
|
|
2002-09-13 14:56:23 +00:00
|
|
|
bool OnConnect(const TString& topic);
|
|
|
|
void OnConnectConfirm(CONNID id);
|
1997-06-03 13:56:29 +00:00
|
|
|
|
|
|
|
public:
|
2002-09-13 14:56:23 +00:00
|
|
|
virtual bool IsOk() const;
|
1997-06-03 13:56:29 +00:00
|
|
|
|
|
|
|
TSocketServer(const char* name);
|
|
|
|
virtual ~TSocketServer();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TSocketClient : public TLanClient
|
|
|
|
{
|
2002-09-13 14:56:23 +00:00
|
|
|
byte* m_pData;
|
|
|
|
size_t m_dwSize;
|
1998-08-25 18:07:30 +00:00
|
|
|
|
1997-06-03 13:56:29 +00:00
|
|
|
protected: // TLanClient
|
2002-09-13 14:56:23 +00:00
|
|
|
virtual TConnection* OnQueryConnection(const char* service, const char* server);
|
2007-03-06 16:37:44 +00:00
|
|
|
int HttpGetHeader(CONNID id, const char* remote, const char* authorization, TString_array& header);
|
2002-09-13 14:56:23 +00:00
|
|
|
|
1997-06-03 13:56:29 +00:00
|
|
|
public:
|
2002-09-13 14:56:23 +00:00
|
|
|
virtual bool Request(CONNID id, const char* cmd);
|
|
|
|
virtual byte* GetBuffer(size_t& dwSize);
|
1997-06-03 13:56:29 +00:00
|
|
|
virtual void ReleaseBuffer();
|
2002-09-13 14:56:23 +00:00
|
|
|
virtual bool IsOk() const { return TRUE; }
|
1997-06-03 13:56:29 +00:00
|
|
|
|
2002-09-13 14:56:23 +00:00
|
|
|
bool WriteLine(CONNID id, const char* str);
|
|
|
|
bool ReadLine(CONNID id, TString& str);
|
1998-12-10 16:25:48 +00:00
|
|
|
|
2007-03-06 16:37:44 +00:00
|
|
|
bool HttpIsRedirectedServer(CONNID id, TString & http_server, TFilename & remote, const char* authorization = NULL);
|
2003-04-22 15:06:36 +00:00
|
|
|
bool HttpGetFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL);
|
2002-09-13 14:56:23 +00:00
|
|
|
bool HttpGetDir(CONNID id, const char* remote, TString_array& list);
|
|
|
|
bool HttpSoap(CONNID id, const char* query);
|
2003-02-25 14:39:02 +00:00
|
|
|
bool HttpPostFile(CONNID id, const char* remote, const char* local, const char* authorization = NULL);
|
2007-12-17 10:32:43 +00:00
|
|
|
bool HttpPutFile(CONNID id, const char* remote, const char* local);
|
|
|
|
bool FtpSendFile(CONNID id, const char* remote, const char* local, const char* user, const char* pass);
|
1998-08-20 14:49:34 +00:00
|
|
|
|
1997-06-03 13:56:29 +00:00
|
|
|
TSocketClient();
|
|
|
|
virtual ~TSocketClient();
|
|
|
|
};
|
|
|
|
|
2007-03-16 13:33:09 +00:00
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2004-03-12 16:01:27 +00:00
|
|
|
#endif
|