socket.hh (5523:6279e78a2df2) socket.hh (12010:032f2717dfb7)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32#define __SOCKET_HH__
33
34class ListenSocket
35{
36 protected:
37 static bool listeningDisabled;
38 static bool anyListening;
39
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 23 unchanged lines hidden (view full) ---

32#define __SOCKET_HH__
33
34class ListenSocket
35{
36 protected:
37 static bool listeningDisabled;
38 static bool anyListening;
39
40 static bool bindToLoopback;
41
40 public:
41 static void disableAll();
42 static bool allDisabled();
43
42 public:
43 static void disableAll();
44 static bool allDisabled();
45
46 static void loopbackOnly();
47
44 protected:
45 bool listening;
46 int fd;
47
48 public:
49 ListenSocket();
50 virtual ~ListenSocket();
51
52 virtual int accept(bool nodelay = false);
53 virtual bool listen(int port, bool reuse = true);
54
55 int getfd() const { return fd; }
56 bool islistening() const { return listening; }
57};
58
59#endif //__SOCKET_HH__
48 protected:
49 bool listening;
50 int fd;
51
52 public:
53 ListenSocket();
54 virtual ~ListenSocket();
55
56 virtual int accept(bool nodelay = false);
57 virtual bool listen(int port, bool reuse = true);
58
59 int getfd() const { return fd; }
60 bool islistening() const { return listening; }
61};
62
63#endif //__SOCKET_HH__