Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: simple TCP socket API for communicating as a TCP client over a TEXT
  4. // connection
  5. //
  6. // $Workfile: $
  7. // $Date: $
  8. //
  9. //-----------------------------------------------------------------------------
  10. // $Log: $
  11. //
  12. // $NoKeywords: $
  13. //=============================================================================//
  14. #ifndef SIMPLESOCKET_H
  15. #define SIMPLESOCKET_H
  16. #pragma once
  17. // opaque socket type
  18. typedef struct socket_s socket_t, *HSOCKET;
  19. // Socket reporting function
  20. typedef void ( *REPORTFUNCTION )( HSOCKET socket, const char *pString );
  21. extern HSOCKET SocketOpen( const char *pServerName, int port );
  22. extern void SocketClose( HSOCKET socket );
  23. extern void SocketSendString( HSOCKET socket, const char *pString );
  24. // This should probably return the data so we can handle errors and receive data
  25. extern void SocketWait( HSOCKET socket, const char *pString );
  26. // sets the reporting function
  27. extern void SocketReport( REPORTFUNCTION pReportFunction );
  28. extern void SocketInit( void );
  29. extern void SocketExit( void );
  30. #endif // SIMPLESOCKET_H