Files correlati : Ricompilazione Demo : [ ] Commento :riportate modifiche dalla 3.1 per poter proseguire con i cespiti git-svn-id: svn://10.65.10.50/trunk@15890 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			76 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			76 lines
		
	
	
		
			2.1 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);
 | 
						|
  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);
 | 
						|
 | 
						|
  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
 |