"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "qftp-0.98/net.h" of archive qftp-0.98.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 /*
2 * qftp
3 * Copyright (C) 1997,1998 Peter Strand
4 * Distributed under the GNU Pulic Licence
5 */
6
7 #ifndef _NET_H
8 #define _NET_H
9
10 #include <arpa/inet.h>
11 #include <netinet/in.h>
12
13 class Host {
14 char name[512];
15 struct hostent *hp;
16 struct in_addr addr;
17 public:
18 Host();
19 Host(char *h);
20 ~Host();
21
22 int Lookup();
23 struct in_addr GetAddr();
24 void SetAddr(struct in_addr);
25 char *GetHost();
26 void SetHost(char *);
27 };
28
29 class Socket {
30 int s;
31 struct sockaddr_in laddr, raddr;
32 char *rhost;
33 char *error;
34 long status;
35
36 char *msgLostConn;
37 public:
38 Socket();
39 Socket(Socket *sock);
40 Socket(int s, sockaddr_in naddr);
41 ~Socket();
42
43 int Connect(Host &h);
44 int Listen();
45 Socket *Accept();
46 void Close();
47 const char *GetError();
48
49 char *GetRHost();
50 int GetLPort();
51 long GetLAddr();
52 struct sockaddr_in GetRSAddr();
53 struct sockaddr_in GetLSAddr();
54 long GetStatus();
55
56 int Read(char *buf, int len = -1);
57 int Write(char *buf, int len);
58 int Readln(char *buf);
59 int Writeln(char *buf);
60 };
61
62
63 #endif
64
65
66
67
68
69