Nets v3.0.0
StreamSessionView Struct Referencefinal

Stream session instance view. More...

#include <stream-server.hpp>

Public Member Functions

 StreamSessionView (StreamSession_T *instance) noexcept
 Creates a new stream stream session handle.
StreamSession_TgetInstance () const noexcept
 Returns stream session view instance.
SocketView getSocket () const noexcept
 Returns stream session socket instance.
SocketAddressView getRemoteAddress () const noexcept
 Returns stream session remote IP address instance.
void * getHandle () const noexcept
 Returns stream session handle.
string getAddress () const
 Returns stream session IP address and port string.
NetsResult send (const void *data, size_t byteCount) noexcept
 Sends stream data to the specified session. (TCP).
NetsResult send (const OutStreamMessage &message) noexcept
 Sends stream message to the specified session. (TCP).
void alive () noexcept
 Resets stream session timeout time.
NetsResult shutdown (SocketShutdown shutdown=RECEIVE_SEND_SOCKET_SHUTDOWN) noexcept
 Shutdowns part of the full-duplex socket connection.

Detailed Description

Stream session instance view.

See the stream-server.h

Constructor & Destructor Documentation

◆ StreamSessionView()

StreamSessionView ( StreamSession_T * instance)
inlinenoexcept

Creates a new stream stream session handle.

Parameters
[in]instancetarget stream session instance

Member Function Documentation

◆ getSocket()

SocketView getSocket ( ) const
inlinenoexcept

Returns stream session socket instance.

See the getStreamSessionSocket().

◆ getRemoteAddress()

SocketAddressView getRemoteAddress ( ) const
inlinenoexcept

Returns stream session remote IP address instance.

See the getStreamSessionRemoteAddress().

◆ getHandle()

void * getHandle ( ) const
inlinenoexcept

Returns stream session handle.

Warning
Handle may be null if socket is not fully connected!

See the createStreamServer().

◆ send() [1/2]

NetsResult send ( const void * data,
size_t byteCount )
inlinenoexcept

Sends stream data to the specified session. (TCP).

See the streamSessionSend().

Warning
You should lock sessions before sending messages!
Returns
The operation NetsResult code.
Parameters
[in]datasend data buffer
byteCountdata byte count to send

◆ send() [2/2]

NetsResult send ( const OutStreamMessage & message)
inlinenoexcept

Sends stream message to the specified session. (TCP).

See the streamSessionSend().

Warning
You should lock sessions before sending messages!
Returns
The operation NetsResult code.
Parameters
[in]messagestream message to send

◆ alive()

void alive ( )
inlinenoexcept

Resets stream session timeout time.

See the aliveStreamSession().

Warning
You should lock sessions before aliving!

◆ shutdown()

NetsResult shutdown ( SocketShutdown shutdown = RECEIVE_SEND_SOCKET_SHUTDOWN)
inlinenoexcept

Shutdowns part of the full-duplex socket connection.

See the shutdownStreamSession().

Warning
You should lock sessions before shutting down!
Returns
The operation NetsResult code.
Parameters
shutdownsocket connection shutdown mode