socket.hh (2665:a124942bacb8) socket.hh (5523:6279e78a2df2)
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;

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

29 */
30
31#ifndef __SOCKET_HH__
32#define __SOCKET_HH__
33
34class ListenSocket
35{
36 protected:
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;

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

29 */
30
31#ifndef __SOCKET_HH__
32#define __SOCKET_HH__
33
34class ListenSocket
35{
36 protected:
37 static bool listeningDisabled;
38 static bool anyListening;
39
40 public:
41 static void disableAll();
42 static bool allDisabled();
43
44 protected:
37 bool listening;
38 int fd;
39
40 public:
41 ListenSocket();
42 virtual ~ListenSocket();
43
44 virtual int accept(bool nodelay = false);
45 virtual bool listen(int port, bool reuse = true);
46
47 int getfd() const { return fd; }
48 bool islistening() const { return listening; }
49};
50
51#endif //__SOCKET_HH__
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__