rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWSecureSocketListener Class Reference
[Secure Sockets]

Creates a secure socket listener, which waits on a user-defined socket address for incoming connections. More...

#include <rw/secsock/RWSecureSocketListener.h>

Inheritance diagram for RWSecureSocketListener:
RWSocketPortalBase

List of all members.

Public Member Functions

 RWSecureSocketListener ()
 RWSecureSocketListener (const RWSockAddrBase &addr, const RWSecureSocketContext &context, int backlog=5)
 RWSecureSocketListener (const RWSecureSocket &socket, WhoShouldClose who=Portal)
 ~RWSecureSocketListener ()
void listen (const RWSockAddrBase &addr, const RWSecureSocketContext &context, int backlog=5)
RWSecureSocketPortal accept (RWSockAddr *addr=0) const
RWSecureSocketPortal operator() (RWSockAddr *addr=0) const
RWSecureSocket getSocket () const

Detailed Description

RWSecureSocketListener creates a secure socket listener, which waits on a user-defined socket address for incoming connections. Connections are obtained as RWSecureSocketPortal instances.


Constructor & Destructor Documentation

RWSecureSocketListener::RWSecureSocketListener (  ) 

Creates an uninitialized secure socket listener. Self cannot be used until is initialized using listen().

RWSecureSocketListener::RWSecureSocketListener ( const RWSockAddrBase addr,
const RWSecureSocketContext context,
int  backlog = 5 
)

Sets up a listener on addr using context, 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.

RWSecureSocketListener::RWSecureSocketListener ( const RWSecureSocket socket,
WhoShouldClose  who = Portal 
)

Creates a listening portal to the communications channel, where socket is the socket doing the listening. This constructor is the only way to create a socket listener whose underlying socket is not closed when portals are not using it.

RWSecureSocketListener::~RWSecureSocketListener (  ) 

Closes the socket if self is the last referencing portal and WhoShouldClose is not Application.


Member Function Documentation

RWSecureSocketPortal RWSecureSocketListener::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.

RWSecureSocket RWSecureSocketListener::getSocket (  )  const

Returns a copy of the RWSecureSocket underlying this RWSecureSocketListener.

void RWSecureSocketListener::listen ( const RWSockAddrBase addr,
const RWSecureSocketContext context,
int  backlog = 5 
)

Binds the listener to addr using context, 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.

RWSecureSocketPortal RWSecureSocketListener::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.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.