|
rllib
1
|
00001 /*************************************************************************** 00002 rlsocket.h - description 00003 ------------------- 00004 begin : Tue Jan 02 2001 00005 copyright : (C) 2001 by Rainer Lehrig 00006 email : lehrig@t-online.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as * 00013 * published by the Free Software Foundation * 00014 * * 00015 ***************************************************************************/ 00016 #ifndef _RL_SOCKET_H_ 00017 #define _RL_SOCKET_H_ 00018 00019 #include "rldefine.h" 00020 00025 #define wsa rlwsa 00026 int rlwsa(); 00027 00031 class rlSocket 00032 { 00033 public: 00034 00035 enum SocketEnum 00036 { 00037 SOCKET_ERR = -1, 00038 SETSOCKOPT_ERR = -2, 00039 LISTEN_ERR = -3, 00040 ACCEPT_ERR = -4, 00041 INET_ADDR_ERR = -5, 00042 CONNECT_ERR = -6, 00043 PORT_ERR = -7 00044 }; 00045 00054 rlSocket(const char *adr, int port, int active); 00055 00060 rlSocket(int socket); 00061 00062 00067 virtual ~rlSocket(); 00068 00072 void setAdr(const char *adr); 00073 00077 void setPort(int port); 00078 00082 int getPort(); 00083 00087 void setActive(int active); 00088 00098 int read(void *buf, int len, int timeout=0); 00099 00109 int readStr(char *buf, int len, int timeout=0); 00110 00116 int write(const void *buf, int len); 00117 00123 int printf(const char *format, ...); 00124 00130 int connect(); 00131 00136 int disconnect(); 00137 00145 int select(int timeout=0); 00146 00151 int isConnected(); 00152 00158 int setIPVersion(int version); 00159 00164 int getIPVersion(); 00165 00169 int sendProcessViewBrowserButtonEvent(int id); 00170 00176 int s; 00177 00211 unsigned char sockaddr[16+48]; 00212 00213 private: 00214 char adr[132]; 00215 int port; 00216 int active; 00217 int os; 00218 int first; 00219 int prefer_ipv6; 00220 int rl_ipversion; 00221 }; 00222 00223 #endif
1.7.5.1