ReactOS  0.4.12-dev-102-g4b7f1e0
tnetwork.h
Go to the documentation of this file.
1 // This is a simple class to handle socket connections
2 // (Paul Brannan 6/15/98)
3 
4 #pragma once
5 
6 //#include <windows.h>
7 
9 
10 typedef int(*Naws_func_t)(char *, int, int);
11 
12 class TNetwork {
13 private:
15  BOOL local_echo; // Paul Brannan 8/25/98
16  BOOL line_mode; // Paul Brannan 12/31/98
17  NetworkType net_type; // Paul Brannan 3/18/99
18  HANDLE pipeIn, pipeOut; // Paul Brannan 3/18/99
21 
22 public:
23  TNetwork(SOCKET s = 0): socket(s), local_echo(1), line_mode(1),
24  net_type(TN_NETSOCKET), naws_func((Naws_func_t)NULL),
25  local_address((char *)NULL) {}
26  ~TNetwork() {if(local_address) delete[] local_address;}
27 
28  void SetSocket(SOCKET s);
29  SOCKET GetSocket() {return socket;}
30  void SetPipe(HANDLE pIn, HANDLE pOut);
31  void SetNawsFunc(Naws_func_t func) {naws_func = func;}
32  void SetLocalAddress(char *buf);
33  const char* GetLocalAddress() {return local_address;}
34 
36 
37  int WriteString(const char *str, const int length);
38  int ReadString (char *str, const int length);
39 
41  void set_local_echo(BOOL b) {local_echo = b;}
42 
44  void set_line_mode(BOOL b) {line_mode = b;}
45 
46  void do_naws(int width, int height);
47 };
GLenum func
Definition: glext.h:6028
GLint GLint GLsizei width
Definition: gl.h:1546
HANDLE pipeIn
Definition: tnetwork.h:18
NetworkType net_type
Definition: tnetwork.h:17
void SetPipe(HANDLE pIn, HANDLE pOut)
Definition: tnetwork.cpp:46
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
TNetwork(SOCKET s=0)
Definition: tnetwork.h:23
void set_local_echo(BOOL b)
Definition: tnetwork.h:41
const char * GetLocalAddress()
Definition: tnetwork.h:33
void SetNawsFunc(Naws_func_t func)
Definition: tnetwork.h:31
~TNetwork()
Definition: tnetwork.h:26
NetworkType
Definition: tnetwork.h:8
void SetLocalAddress(char *buf)
Definition: tnetwork.cpp:88
BOOL get_local_echo()
Definition: tnetwork.h:40
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:27
HANDLE pipeOut
Definition: tnetwork.h:18
SOCKET socket
Definition: tnetwork.h:14
#define b
Definition: ke_i.h:79
int(* Naws_func_t)(char *, int, int)
Definition: tnetwork.h:10
void SetSocket(SOCKET s)
Definition: tnetwork.cpp:40
BOOL local_echo
Definition: tnetwork.h:15
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
int WriteString(const char *str, const int length)
Definition: tnetwork.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL line_mode
Definition: tnetwork.h:16
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
char * local_address
Definition: tnetwork.h:20
NetworkType get_net_type()
Definition: tnetwork.h:35
int ReadString(char *str, const int length)
Definition: tnetwork.cpp:67
GLdouble s
Definition: gl.h:2039
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
BOOL get_line_mode()
Definition: tnetwork.h:43
Naws_func_t naws_func
Definition: tnetwork.h:19
void do_naws(int width, int height)
Definition: tnetwork.cpp:81
UINT_PTR SOCKET
Definition: winsock.h:47
SOCKET GetSocket()
Definition: tnetwork.h:29
void set_line_mode(BOOL b)
Definition: tnetwork.h:44
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:29