17#ifndef _DECAF_NET_SERVERSOCKET_H_
18#define _DECAF_NET_SERVERSOCKET_H_
58 mutable volatile bool created;
68 ServerSocket(
const ServerSocket&);
69 ServerSocket& operator=(
const ServerSocket&);
175 virtual void bind(
const std::string& host,
int port);
195 virtual void bind(
const std::string& host,
int port,
int backlog);
Represents an IP address.
Definition InetAddress.h:33
ServerSocket()
Creates a non-bound server socket.
ServerSocket(int port, int backlog, const InetAddress *address)
Creates a new ServerSocket bound to the specified port, if the value of port is 0,...
virtual void bind(const std::string &host, int port, int backlog)
Bind and listen to given local IPAddress and port, if the address is empty than a valid local address...
virtual int getDefaultBacklog()
Allows a subclass to override what is considered the default backlog.
virtual ~ServerSocket()
Releases socket handle if close() hasn't been called.
ServerSocket(int port, int backlog)
Creates a new ServerSocket bound to the specified port, if the value of port is 0,...
virtual void close()
Closes the server socket, causing any Threads blocked on an accept call to throw an Exception.
virtual bool getReuseAddress() const
Gets the reuse address flag, SO_REUSEADDR.
virtual bool isClosed() const
virtual int getReceiveBufferSize() const
Gets the receive buffer size for this socket, SO_RCVBUF.
virtual int getLocalPort() const
Gets the port number on the Local machine that this ServerSocket is bound to.
virtual void setSoTimeout(int timeout)
Sets the timeout for socket operations, SO_TIMEOUT.
ServerSocket(SocketImpl *impl)
Creates a ServerSocket wrapping the provided SocketImpl instance, this Socket is considered unconnect...
void ensureCreated() const
virtual std::string toString() const
virtual int getSoTimeout() const
Gets the timeout for socket operations, SO_TIMEOUT.
ServerSocket(int port)
Creates a new ServerSocket bound to the specified port, if the value of port is 0,...
virtual void setReceiveBufferSize(int size)
Sets the receive buffer size for this socket, SO_RCVBUF.
virtual void setReuseAddress(bool reuse)
Sets the reuse address flag, SO_REUSEADDR.
static void setSocketImplFactory(SocketImplFactory *factory)
Sets the instance of a SocketImplFactory that the ServerSocket class should use when new instances of...
void setupSocketImpl(int port, int backlog, const InetAddress *ifAddress)
virtual bool isBound() const
virtual Socket * accept()
Listens for a connection request on the bound IPAddress and Port for this ServerSocket,...
virtual void implAccept(Socket *socket)
Virtual method that allows a ServerSocket subclass to override the accept call and provide its own So...
virtual void bind(const std::string &host, int port)
Bind and listen to given local IPAddress and port, if the address is empty than a valid local address...
Factory class interface for a Factory that creates ScoketImpl objects.
Definition SocketImplFactory.h:38
Acts as a base class for all physical Socket implementations.
Definition SocketImpl.h:42
#define DECAF_API
Definition Config.h:29
Definition URLStreamHandlerManager.h:26
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25