aboutsummaryrefslogtreecommitdiff
path: root/src/stable/serversocket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stable/serversocket.h')
-rw-r--r--src/stable/serversocket.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/stable/serversocket.h b/src/stable/serversocket.h
new file mode 100644
index 0000000..cb2591d
--- /dev/null
+++ b/src/stable/serversocket.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2007-2019 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
8#ifndef BU_SERVER_SOCKET_H
9#define BU_SERVER_SOCKET_H
10
11#include <stdint.h>
12
13namespace Bu
14{
15 class Socket;
16
17 /**
18 * Abstract representation of a server socket of some kind. Maybe socket
19 * isn't strictly accurate. This could be a tcp/ip socket, a named
20 * filesystem based socket, etc.
21 *
22 *@ingroup Serving
23 */
24 class ServerSocket
25 {
26 public:
27 ServerSocket();
28 virtual ~ServerSocket();
29
30 /**
31 * Accept a new connection, returning a connected Bu::Socket object.
32 */
33 virtual Bu::Socket *accept( int nTimeoutSec=0, int nTimeoutUSec=0 )=0;
34
35 /**
36 * Provide the contained file descriptor. Return false if there is no
37 * internal file descriptor as such. If the return value is true, then
38 * rFdOut will be set to the file descriptor.
39 */
40 virtual bool getFd( int &rFdOut ) const=0;
41 };
42}
43
44#endif