libzypp: zyppng::SocketPrivate Class Reference

libzypp 17.38.13

zyppng::SocketPrivate Class Reference

`#include <zypp-core/ng/io/private/socket_p.h>`

Inheritance diagram for zyppng::SocketPrivate:

## Classes
struct | InitialState
struct | ConnectingState
struct | ConnectedState
struct | ListeningState
struct | ClosingState
struct | ClosedState

## Public Member Functions
| SocketPrivate (int domain, int type, int protocol, Socket &p)
bool | initSocket ()
void | setError (Socket::SocketError error, std::string &&err, bool emit=true)
bool | handleConnectError (int error)
bool | transition (Socket::SocketState newState)
Socket::SocketState | state () const
bool | connectToHost ()
void | onSocketActivated (int ev)
void | onSocketActivatedSlot (const SocketNotifier &, int ev)
int64_t | rawBytesAvailable () const
bool | readRawBytesToBuffer ()
bool | writePendingData ()
Public Member Functions inherited from zyppng::IODevicePrivate
| IODevicePrivate (IODevice &p)
Public Member Functions inherited from zyppng::BasePrivate
| BasePrivate (Base &b)
virtual | ~BasePrivate ()
virtual void | init ()

## Static Public Member Functions
static Socket::Ptr | wrapSocket (int fd, int domain, int type, int protocol, Socket::SocketState state)

## Public Attributes
int | _domain
int | _type
int | _protocol
std::shared_ptr< SockAddr > | _targetAddr
int | _socket = -1
bool | _borrowedSocket = false
bool | _emittedErr = false
Socket::SocketError | _error = Socket::NoError
std::string | _errorDesc
Signal< void(Socket::SocketError)> | _sigError
Signal< void()> | _incomingConnection
Signal< void()> | _connected
Signal< void()> | _disconnected
std::variant< InitialState, ConnectingState, ConnectedState, ListeningState, ClosingState, ClosedState > | _state = InitialState()
Public Attributes inherited from zyppng::IODevicePrivate
std::vector< IOBuffer > | _readChannels
uint | _currentReadChannel = 0
int64_t | _readBufChunkSize = DefIoDeviceBufChunkSize
IODevice::OpenMode | _mode = IODevice::Closed
Signal< void() > | _readyRead
Signal< void(uint) > | _channelReadyRead
Signal< void(int64_t)> | _sigBytesWritten
Signal< void()> | _sigAllBytesWritten
Signal< void(uint) > | _sigReadChannelFinished
Public Attributes inherited from zyppng::BasePrivate
Base::WeakPtr | parent
std::unordered_set< Base::Ptr > | children
std::unordered_map< uint32_t, zypp::AutoDispose< void * > > | _data
Base * | z_ptr = nullptr
std::thread::id | threadId = std::this_thread::get_id()

## Detailed Description

Definition at line 28 of file socket_p.h.

## Constructor & Destructor Documentation

## ◆ SocketPrivate()

zyppng::SocketPrivate::SocketPrivate | ( | int | domain,
|  | int | type,
|  | int | protocol,
|  | Socket & | p )
| inline

Definition at line 33 of file socket_p.h.

## Member Function Documentation

## ◆ wrapSocket()

Socket::Ptr zyppng::SocketPrivate::wrapSocket | ( | int | fd,
|  | int | domain,
|  | int | type,
|  | int | protocol,
|  | Socket::SocketState | state )
| static

Definition at line 418 of file socket.cc.

## ◆ initSocket()

bool zyppng::SocketPrivate::initSocket | ( |  | ) |

Definition at line 21 of file socket.cc.

## ◆ setError()

void zyppng::SocketPrivate::setError | ( | Socket::SocketError | error,
|  | std::string && | err,
|  | bool | emit = true )

Definition at line 60 of file socket.cc.

## ◆ handleConnectError()

bool zyppng::SocketPrivate::handleConnectError | ( | int | error | ) |

Maps error into a Socket::SocketError and sets it accordingly in the socket. Returns false if the error is fatal and connection needs to stop.

Definition at line 300 of file socket.cc.

## ◆ transition()

bool zyppng::SocketPrivate::transition | ( | Socket::SocketState | newState | ) |

Definition at line 72 of file socket.cc.

## ◆ state()

Socket::SocketState zyppng::SocketPrivate::state | ( |  | ) | const

Definition at line 413 of file socket.cc.

## ◆ connectToHost()

bool zyppng::SocketPrivate::connectToHost | ( |  | ) |

Definition at line 143 of file socket.cc.

## ◆ onSocketActivated()

void zyppng::SocketPrivate::onSocketActivated | ( | int | ev | ) |

Definition at line 343 of file socket.cc.

## ◆ onSocketActivatedSlot()

void zyppng::SocketPrivate::onSocketActivatedSlot | ( | const SocketNotifier & | ,
|  | int | ev )
| inline

Definition at line 50 of file socket_p.h.

## ◆ rawBytesAvailable()

int64_t zyppng::SocketPrivate::rawBytesAvailable | ( |  | ) | const

Definition at line 202 of file socket.cc.

## ◆ readRawBytesToBuffer()

bool zyppng::SocketPrivate::readRawBytesToBuffer | ( |  | ) |

Definition at line 210 of file socket.cc.

## ◆ writePendingData()

bool zyppng::SocketPrivate::writePendingData | ( |  | ) |

Definition at line 253 of file socket.cc.

## Member Data Documentation

## ◆ _domain

int zyppng::SocketPrivate::_domain

Definition at line 57 of file socket_p.h.

## ◆ _type

int zyppng::SocketPrivate::_type

Definition at line 58 of file socket_p.h.

## ◆ _protocol

int zyppng::SocketPrivate::_protocol

Definition at line 59 of file socket_p.h.

## ◆ _targetAddr

std::shared_ptr<SockAddr> zyppng::SocketPrivate::_targetAddr

Definition at line 60 of file socket_p.h.

## ◆ _socket

int zyppng::SocketPrivate::_socket = -1

Definition at line 62 of file socket_p.h.

## ◆ _borrowedSocket

bool zyppng::SocketPrivate::_borrowedSocket = false

Definition at line 63 of file socket_p.h.

## ◆ _emittedErr

bool zyppng::SocketPrivate::_emittedErr = false

Definition at line 66 of file socket_p.h.

## ◆ _error

Socket::SocketError zyppng::SocketPrivate::_error = Socket::NoError

Definition at line 67 of file socket_p.h.

## ◆ _errorDesc

std::string zyppng::SocketPrivate::_errorDesc

Definition at line 68 of file socket_p.h.

## ◆ _sigError

Signal< void(Socket::SocketError)> zyppng::SocketPrivate::_sigError

Definition at line 71 of file socket_p.h.

## ◆ _incomingConnection

Signal< void()> zyppng::SocketPrivate::_incomingConnection

Definition at line 72 of file socket_p.h.

## ◆ _connected

Signal< void()> zyppng::SocketPrivate::_connected

Definition at line 73 of file socket_p.h.

## ◆ _disconnected

Signal< void()> zyppng::SocketPrivate::_disconnected

Definition at line 74 of file socket_p.h.

## ◆ _state

std::variant< InitialState, ConnectingState, ConnectedState, ListeningState, ClosingState, ClosedState > zyppng::SocketPrivate::_state = InitialState()

Definition at line 117 of file socket_p.h.

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

- zypp-core/ng/io/private/socket_p.h
- zypp-core/ng/io/socket.cc