ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

tnetwork.h
Go to the documentation of this file.
00001 // This is a simple class to handle socket connections
00002 // (Paul Brannan 6/15/98)
00003 
00004 #pragma once
00005 
00006 #include <windows.h>
00007 
00008 enum NetworkType {TN_NETSOCKET, TN_NETPIPE};
00009 
00010 typedef int(*Naws_func_t)(char *, int, int);
00011 
00012 class TNetwork {
00013 private:
00014     SOCKET socket;
00015     BOOL local_echo;                    // Paul Brannan 8/25/98
00016     BOOL line_mode;                     // Paul Brannan 12/31/98
00017     NetworkType net_type;               // Paul Brannan 3/18/99
00018     HANDLE pipeIn, pipeOut;             // Paul Brannan 3/18/99
00019     Naws_func_t naws_func;
00020     char *local_address;
00021 
00022 public:
00023     TNetwork(SOCKET s = 0): socket(s), local_echo(1), line_mode(1),
00024         net_type(TN_NETSOCKET), naws_func((Naws_func_t)NULL),
00025         local_address((char *)NULL) {}
00026     ~TNetwork() {if(local_address) delete[] local_address;}
00027 
00028     void SetSocket(SOCKET s);
00029     SOCKET GetSocket() {return socket;}
00030     void SetPipe(HANDLE pIn, HANDLE pOut);
00031     void SetNawsFunc(Naws_func_t func) {naws_func = func;}
00032     void SetLocalAddress(char *buf);
00033     const char* GetLocalAddress() {return local_address;}
00034 
00035     NetworkType get_net_type() {return net_type;}
00036 
00037     int WriteString(const char *str, const int length);
00038     int ReadString (char *str, const int length);
00039 
00040     BOOL get_local_echo() {return local_echo;}
00041     void set_local_echo(BOOL b) {local_echo = b;}
00042 
00043     BOOL get_line_mode() {return line_mode;}
00044     void set_line_mode(BOOL b) {line_mode = b;}
00045 
00046     void do_naws(int width, int height);
00047 };

Generated on Fri May 25 2012 04:15:34 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.