From 915005e218b5d00939b548de65ce6354f7acb487 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 28 Jul 2023 21:18:56 -0700 Subject: Completely redesigned Server and Client. Like, seriously, they're almost completely different. --- src/stable/serversocket.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/stable/serversocket.h (limited to 'src/stable/serversocket.h') 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 @@ +/* + * Copyright (C) 2007-2019 Xagasoft, All rights reserved. + * + * This file is part of the libbu++ library and is released under the + * terms of the license contained in the file LICENSE. + */ + +#ifndef BU_SERVER_SOCKET_H +#define BU_SERVER_SOCKET_H + +#include + +namespace Bu +{ + class Socket; + + /** + * Abstract representation of a server socket of some kind. Maybe socket + * isn't strictly accurate. This could be a tcp/ip socket, a named + * filesystem based socket, etc. + * + *@ingroup Serving + */ + class ServerSocket + { + public: + ServerSocket(); + virtual ~ServerSocket(); + + /** + * Accept a new connection, returning a connected Bu::Socket object. + */ + virtual Bu::Socket *accept( int nTimeoutSec=0, int nTimeoutUSec=0 )=0; + + /** + * Provide the contained file descriptor. Return false if there is no + * internal file descriptor as such. If the return value is true, then + * rFdOut will be set to the file descriptor. + */ + virtual bool getFd( int &rFdOut ) const=0; + }; +} + +#endif -- cgit v1.2.3