net_sock.hh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /********************************************************************** <BR>
  2. This file is part of Crack dot Com's free source code release of
  3. Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
  4. information about compiling & licensing issues visit this URL</a>
  5. <PRE> If that doesn't help, contact Jonathan Clark at
  6. golgotha_source@usa.net (Subject should have "GOLG" in it)
  7. ***********************************************************************/
  8. #ifndef I4_NET_SOCKET_HH
  9. #define I4_NET_SOCKET_HH
  10. #include "arch.hh"
  11. #include "file/file.hh"
  12. class i4_net_address;
  13. class i4_net_socket : public i4_file_class
  14. {
  15. public:
  16. virtual i4_bool connect(i4_net_address *addr) { return i4_F; }
  17. virtual i4_bool accept(i4_net_socket *&sock, i4_net_address *&addr) = 0;
  18. virtual w32 read_from(void *buffer, w32 size, i4_net_address *&addr) = 0;
  19. virtual w32 read (void *buffer, w32 size) = 0;
  20. virtual w32 write(const void *buffer, w32 size) = 0;
  21. virtual i4_bool ready_to_read() = 0;
  22. virtual i4_bool ready_to_write() = 0;
  23. virtual i4_bool error_occurred() = 0;
  24. virtual w32 seek (w32 offset) { return 0; }
  25. virtual w32 size () { return 0; }
  26. virtual w32 tell () { return 0; }
  27. virtual void set_select_status(i4_bool read, i4_bool write, i4_bool error) = 0;
  28. };
  29. #endif