From 8898ad9b25fca6afe2374d293a981db02a83d7e9 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 31 May 2012 14:46:27 +0000 Subject: Committing the documentation to svn to have it accessible online --- Doc/doxygen/html/_net_layer_8cpp_source.html | 210 +++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 Doc/doxygen/html/_net_layer_8cpp_source.html (limited to 'Doc/doxygen/html/_net_layer_8cpp_source.html') diff --git a/Doc/doxygen/html/_net_layer_8cpp_source.html b/Doc/doxygen/html/_net_layer_8cpp_source.html new file mode 100644 index 0000000..7ef1826 --- /dev/null +++ b/Doc/doxygen/html/_net_layer_8cpp_source.html @@ -0,0 +1,210 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/NetEx/NetLayer.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
NetLayer.cpp
+
+
+Go to the documentation of this file.
1 /* Project nGenEx
+
2  Destroyer Studios LLC
+
3  Copyright © 1997-2004. All Rights Reserved.
+
4 
+
5  SUBSYSTEM: NetEx.lib
+
6  FILE: NetLayer.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  Wrapper for WinSock Library
+
13 */
+
14 
+
15 
+
16 #include "MemDebug.h"
+
17 #include <windows.h>
+
18 #include "NetLayer.h"
+
19 
+
20 #include <mmsystem.h>
+
21 #include <time.h>
+
22 
+
23 // +-------------------------------------------------------------------+
+
24 
+
25 static DWORD baseTime = timeGetTime();
+
26 
+
27 // +-------------------------------------------------------------------+
+
28 
+ +
30 {
+
31  fail = false;
+
32  ZeroMemory(&info, sizeof(info));
+
33 
+
34  WORD ver = MAKEWORD(2,2);
+
35  int err = WSAStartup(ver, &info);
+
36 
+
37  if (err)
+
38  fail = true;
+
39 }
+
40 
+ +
42 {
+
43  WSACleanup();
+
44 }
+
45 
+
46 bool
+
47 NetLayer::OK() const
+
48 {
+
49  return !fail;
+
50 }
+
51 
+
52 const char*
+ +
54 {
+
55  return info.szDescription;
+
56 }
+
57 
+
58 int
+ +
60 {
+
61  return WSAGetLastError();
+
62 }
+
63 
+
64 DWORD
+ +
66 {
+
67  DWORD msec = timeGetTime();
+
68 
+
69  if (msec >= baseTime) {
+
70  return msec - baseTime;
+
71  }
+
72 
+
73  else {
+
74  DWORD extra = 0xffffffff;
+
75  return msec + extra - baseTime;
+
76  }
+
77 }
+
78 
+
79 long
+ +
81 {
+
82  return (long) time(0);
+
83 }
+
84 
+
85 Text
+ +
87 {
+
88  char hostname[256];
+
89  ZeroMemory(hostname, sizeof(hostname));
+
90  ::gethostname(hostname, sizeof(hostname));
+
91 
+
92  return hostname;
+
93 }
+
+
+ + + + -- cgit v1.1