WXP C++ Library Version 6.74.6
Loading...
Searching...
No Matches
Socket.h
1#ifndef _WINC_SOCKET
2#define _WINC_SOCKET
3
4namespace WXP {
5 class Socket {
6 int type;
7 char host[50];
8 int port;
9 int fd;
10 int sfd;
11 unsigned char data[1000];
12 int size;
13 int ind;
14 bool opened;
15
16 public:
17 Socket( );
18 ~Socket( );
19 int init();
20 bool isOpen();
21 int open( const char *address, int type );
22 int close();
23 int reconnect();
24 int read( unsigned char *buf, int size );
25 int readLine( unsigned char *buf, int size );
26 int write( const unsigned char *buf, int size );
27
28 /*
29 Socket types
30 */
31 enum Type {
32 UNK,
33 DGRAM,
34 DGRAM_SERVER,
35 DGRAM_CLIENT,
36 STREAM,
37 STREAM_SERVER,
38 STREAM_CLIENT
39 };
40 };
41}
42#endif
This class manages socket based network connections.
Definition: Socket.h:5
int read(unsigned char *buf, int size)
Definition: Socket.cc:189
int open(const char *address, int type)
Definition: Socket.cc:52
int init()
Definition: Socket.cc:38
int readLine(unsigned char *buf, int size)
Definition: Socket.cc:213
Socket()
Definition: Socket.cc:24
~Socket()
Definition: Socket.cc:31
int close()
Definition: Socket.cc:173
All WXP classes fall under the WXP namespace.
Definition: Angle.h:4