Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::iocp::v1::Context Class Referencefinal

Completion port operation context based on sese-event. More...

#include <IOCPServer_V1.h>

Inheritance diagram for sese::iocp::v1::Context:
sese::io::InputStream sese::io::OutputStream sese::io::PeekableStream

Public Member Functions

int64_t read (void *buffer, size_t length) override
 
int64_t write (const void *buffer, size_t length) override
 
int64_t peek (void *buffer, size_t length) override
 
int64_t trunc (size_t length) override
 
int32_t getFd () const
 
void * getData () const
 
void setData (void *p_data)
 
- Public Member Functions inherited from sese::io::InputStream
virtual ~InputStream () noexcept=default
 
- Public Member Functions inherited from sese::io::OutputStream
virtual ~OutputStream () noexcept=default
 
int64_t write (const std::string_view &buffer)
 
int64_t write (const text::StringView &buffer)
 
template<typename T >
int64_t write (std::vector< T > &buffer)
 
template<typename T , size_t N>
int64_t write (std::array< T, N > &buffer)
 
- Public Member Functions inherited from sese::io::PeekableStream
virtual ~PeekableStream ()=default
 

Private Attributes

IOCPServerself {}
 
IOCPServiceclient {}
 
socket_t fd {0}
 
void * ssl {}
 
bool isConn {false}
 
event::BaseEventevent {}
 
service::v2::TimeoutEventtimeoutEvent {}
 
io::ByteBuilder send {8192, 8192}
 
io::ByteBuilder recv {8192, 8192}
 
void * data {}
 

Friends

class IOCPServer
 
class IOCPService
 

Additional Inherited Members

- Public Types inherited from sese::io::InputStream
typedef std::shared_ptr< InputStreamPtr
 
- Public Types inherited from sese::io::OutputStream
typedef std::shared_ptr< OutputStreamPtr
 
- Public Types inherited from sese::io::PeekableStream
typedef std::shared_ptr< PeekableStreamPtr
 

Detailed Description

Completion port operation context based on sese-event.

Member Function Documentation

◆ getData()

void * sese::iocp::v1::Context::getData ( ) const
inlinenodiscard

Get additional data of the current context

Returns
Additional data

References data.

◆ getFd()

int32_t sese::iocp::v1::Context::getFd ( ) const
inlinenodiscard

Get the file descriptor of the current context connection

Returns
File descriptor

References fd.

◆ peek()

int64_t Context::peek ( void * buffer,
size_t length )
overridevirtual

Read content from the current connection without advancing

Parameters
bufferBuffer
lengthSize of buffer
Returns
Actual read size

Implements sese::io::PeekableStream.

References sese::io::AbstractByteBuffer::peek(), and recv.

◆ read()

int64_t Context::read ( void * buffer,
size_t length )
overridevirtual

Read content from the current connection

Parameters
bufferBuffer
lengthSize of buffer
Returns
Actual read size

Implements sese::io::InputStream.

References sese::io::AbstractByteBuffer::read(), and recv.

◆ setData()

void sese::iocp::v1::Context::setData ( void * p_data)
inline

Set additional data for the current context

Parameters
p_dataAdditional data

References data.

◆ trunc()

int64_t Context::trunc ( size_t length)
overridevirtual

Advance in the current connection without reading content

Parameters
lengthAdvance size
Returns
Actual advance size

Implements sese::io::PeekableStream.

References recv, and sese::io::AbstractByteBuffer::trunc().

◆ write()

int64_t Context::write ( const void * buffer,
size_t length )
overridevirtual

Write content to the current connection

Parameters
bufferBuffer
lengthSize of buffer
Returns
Actual written size

Implements sese::io::OutputStream.

References send, and sese::io::AbstractByteBuffer::write().

Friends And Related Symbol Documentation

◆ IOCPServer

friend class IOCPServer
friend

◆ IOCPService

friend class IOCPService
friend

Member Data Documentation

◆ client

◆ data

void* sese::iocp::v1::Context::data {}
private

Referenced by getData(), and setData().

◆ event

◆ fd

◆ isConn

bool sese::iocp::v1::Context::isConn {false}
private

◆ recv

io::ByteBuilder sese::iocp::v1::Context::recv {8192, 8192}
private

Referenced by peek(), read(), and trunc().

◆ self

◆ send

io::ByteBuilder sese::iocp::v1::Context::send {8192, 8192}
private

Referenced by write().

◆ ssl

void* sese::iocp::v1::Context::ssl {}
private

◆ timeoutEvent


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