Leaked source code of windows server 2003
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.

76 lines
2.2 KiB

  1. /************************************************************************
  2. * *
  3. * INTEL CORPORATION PROPRIETARY INFORMATION *
  4. * *
  5. * This software is supplied under the terms of a license *
  6. * agreement or non-disclosure agreement with Intel Corporation *
  7. * and may not be copied or disclosed except in accordance *
  8. * with the terms of that agreement. *
  9. * *
  10. * Copyright (C) 1997 Intel Corp. All Rights Reserved *
  11. * *
  12. * $Archive: S:\sturgeon\src\gki\vcs\gksocket.h_v $
  13. * *
  14. * $Revision: 1.2 $
  15. * $Date: 10 Jan 1997 16:15:50 $
  16. * *
  17. * $Author: CHULME $
  18. * *
  19. * $Log: S:\sturgeon\src\gki\vcs\gksocket.h_v $
  20. *
  21. * Rev 1.2 10 Jan 1997 16:15:50 CHULME
  22. * Removed MFC dependency
  23. *
  24. * Rev 1.1 22 Nov 1996 15:24:10 CHULME
  25. * Added VCS log to the header
  26. *************************************************************************/
  27. // gksocket.h : interface of the CGKSocket class
  28. // See gksocket.cpp for the implementation of this class
  29. /////////////////////////////////////////////////////////////////////////////
  30. #ifndef GKSOCKET_H
  31. #define GKSOCKET_H
  32. #undef _WIN32_WINNT // override bogus platform definition in our common build environment
  33. //#include <winsock.h>
  34. class CGKSocket
  35. {
  36. private:
  37. SOCKET m_hSocket;
  38. int m_nLastErr;
  39. int m_nAddrFam;
  40. unsigned short m_usPort;
  41. struct sockaddr_in m_sAddrIn;
  42. public:
  43. CGKSocket();
  44. ~CGKSocket();
  45. int Create(int nAddrFam, unsigned short usPort);
  46. int Connect(PSOCKADDR_IN pAddr);
  47. int Send(char *pBuffer, int nLen);
  48. int Receive(char *pBuffer, int nLen);
  49. int SendBroadcast(char *pBuffer, int nLen);
  50. int ReceiveFrom(char *pBuffer, int nLen);
  51. int SendTo(char *pBuffer, int nLen, const struct sockaddr FAR * to, int tolen);
  52. int Close(void);
  53. unsigned short GetPort(void)
  54. {
  55. return (m_usPort);
  56. }
  57. int GetLastError(void)
  58. {
  59. return (m_nLastErr);
  60. }
  61. int GetAddrFam(void)
  62. {
  63. return (m_nAddrFam);
  64. }
  65. };
  66. #endif // GKSOCKET_H
  67. /////////////////////////////////////////////////////////////////////////////