Old fashion design for PC-104
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.

66 lines
1.5 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgSocketClient.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgSocketClient.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "LgSocketClient.h"
  16. /*
  17. template<class BASE_SOCKET>
  18. CLgSocketClient<BASE_SOCKET>::CLgSocketClient()
  19. {
  20. }
  21. template<class BASE_SOCKET>
  22. CLgSocketClient<BASE_SOCKET>::~CLgSocketClient()
  23. {
  24. Destroy();
  25. }
  26. // Do not edit the following lines, which are needed by ClassWizard.
  27. #if 0
  28. BEGIN_MESSAGE_MAP(CLgSocketClient, BASE_SOCKET)
  29. //{{AFX_MSG_MAP(CLgSocketClient)
  30. //}}AFX_MSG_MAP
  31. END_MESSAGE_MAP()
  32. #endif // 0
  33. template<class BASE_SOCKET>
  34. BOOL CLgSocketClient<BASE_SOCKET>::Create( LPCTSTR lpszHostAddress, UINT nHostPort )
  35. {
  36. // create socket
  37. if( !BASE_SOCKET::Create() )
  38. return FALSE;
  39. // establish connection with server
  40. if( !BASE_SOCKET::Connect( lpszHostAddress, nHostPort ) )
  41. {
  42. DWORD dwError = GetLastError();
  43. switch( dwError )
  44. {
  45. case WSAEWOULDBLOCK:
  46. break;
  47. default:
  48. return FALSE;
  49. }
  50. }
  51. return TRUE;
  52. }
  53. template<class BASE_SOCKET>
  54. void CLgSocketClient<BASE_SOCKET>::Destroy()
  55. {
  56. // close socket
  57. Close();
  58. }
  59. */