SourcePro 11.1 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Waits on a specified socket address for incoming connections. More...
#include <rw/network/RWSocketListener.h>
Public Member Functions | |
RWSocketListener () | |
RWSocketListener (const RWSockAddrBase &address, int backlog=5) | |
RWSocketListener (const RWSocket &socket, WhoShouldClose who=Portal) | |
~RWSocketListener () | |
void | listen (const RWSockAddrBase &address, int backlog=5) |
RWSocketPortal | accept (RWSockAddr *addr=0) const |
RWSocketPortal | operator() (RWSockAddr *addr=0) const |
RWSocket | getSocket () const |
Waits on a specified socket address for incoming connections. Connections are obtained as RWSocketPortal instances.
RWSocketListener::RWSocketListener | ( | ) |
Creates an uninitialized socket listener. Self
needs to be initialized using listen() before it can be used.
RWSocketListener::RWSocketListener | ( | const RWSockAddrBase & | address, | |
int | backlog = 5 | |||
) |
Sets up a listener on the address indicated, and sets up a queue to wait for connections. The backlog parameter specifies the number of incoming connection requests that the protocol software enqueues while a connection is being processed.
RWSocketListener::RWSocketListener | ( | const RWSocket & | socket, | |
WhoShouldClose | who = Portal | |||
) |
Creates a listening portal to the communications channel, where socket is the socket doing the listening. Using this constructor is the only way to create a socket that is not closed automatically when portals are no longer using it.
RWSocketListener::~RWSocketListener | ( | ) |
Destructor.
RWSocketPortal RWSocketListener::accept | ( | RWSockAddr * | addr = 0 |
) | const |
Receives the next waiting connection. The address of the connecting client will be stored in the RWSockAddr referenced by addr.
RWSocket RWSocketListener::getSocket | ( | ) | const |
Obtains a reference to the underlying socket.
void RWSocketListener::listen | ( | const RWSockAddrBase & | address, | |
int | backlog = 5 | |||
) |
Binds the listener to the address indicated, and sets up a queue to wait for connections. The backlog parameter specifies the number of incoming connection requests that the protocol software enqueues while a connection is being processed.
RWSocketPortal RWSocketListener::operator() | ( | RWSockAddr * | addr = 0 |
) | const |
Receives the next waiting connection. The address of the connecting client will be stored in the RWSockAddr referenced by addr.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.