Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cNetServerPort Class Reference

#include <cNetServer.h>

Inheritance diagram for GrayLib::cNetServerPort:
Gray::cRefBase IUnknown

Public Member Functions

 cNetServerPort ()
 
 cNetServerPort (const cNetAddress &rSockAddr)
 
HASHCODE_t get_HashCode () const noexcept
 
HRESULT SetAddress (const cNetAddress &rSockAddr)
 
HRESULT CreateBindAndListen ()
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 

Public Attributes

cNetAddress m_SockAddr
 What local address am i bound to? (or should be bound to) may be all adapter/interfaces for the same family. More...
 
cProtocolFactories m_Factories
 What protocols does this port support/prefer ? More...
 
cNetSocket m_Socket
 Open listen socket. More...
 

Detailed Description

a single listen/incoming port for cNetServer. It can have its own set of preferred protocols with cProtocolFactories. Locked to a single sa_family_t. e.g. AF_INET, AF_INET6, etc. May be specific to adapter. (or be on all adapter/interfaces for the same family)

Constructor & Destructor Documentation

◆ cNetServerPort() [1/2]

GrayLib::cNetServerPort::cNetServerPort ( )

Expect SetAddress() to be called.

◆ cNetServerPort() [2/2]

GrayLib::cNetServerPort::cNetServerPort ( const cNetAddress rSockAddr)

Member Function Documentation

◆ CreateBindAndListen()

HRESULT GrayLib::cNetServerPort::CreateBindAndListen ( )

Create the socket. bind it and start listen. If the listen socket is on random port then figure out what port i got and return it in m_SockAddr

◆ get_HashCode()

HASHCODE_t GrayLib::cNetServerPort::get_HashCode ( ) const
inlinenoexcept

◆ SetAddress()

HRESULT GrayLib::cNetServerPort::SetAddress ( const cNetAddress rSockAddr)

Monitor/listen on this new local socket address/port.

Member Data Documentation

◆ m_Factories

cProtocolFactories GrayLib::cNetServerPort::m_Factories

What protocols does this port support/prefer ?

◆ m_SockAddr

cNetAddress GrayLib::cNetServerPort::m_SockAddr

What local address am i bound to? (or should be bound to) may be all adapter/interfaces for the same family.

◆ m_Socket

cNetSocket GrayLib::cNetServerPort::m_Socket

Open listen socket.


The documentation for this class was generated from the following files: