Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
Data stream socket interface. More...
#include <IDataSocket.h>
Classes | |
class | ConnectionFailedInfo |
Public Member Functions | |
IDataSocket (const IEventQueue *events) | |
manipulators | |
virtual void | connect (const NetworkAddress &)=0 |
Connect socket. | |
void | bind (const NetworkAddress &) override=0 |
Bind socket to address. | |
void | close () override |
Close socket. | |
void * | getEventTarget () const override |
Get event target. | |
uint32_t | read (void *buffer, uint32_t n) override=0 |
Read from stream. | |
void | write (const void *buffer, uint32_t n) override=0 |
Write to stream. | |
void | flush () override=0 |
Flush the stream. | |
void | shutdownInput () override=0 |
Shutdown input. | |
void | shutdownOutput () override=0 |
Shutdown output. | |
bool | isReady () const override=0 |
Test if read() will succeed. | |
uint32_t | getSize () const override=0 |
Get bytes available to read. | |
virtual bool | isFatal () const =0 |
Public Member Functions inherited from ISocket | |
Public Member Functions inherited from IInterface | |
virtual | ~IInterface ()=default |
Interface destructor does nothing. | |
Public Member Functions inherited from deskflow::IStream | |
IStream ()=default |
Data stream socket interface.
This interface defines the methods common to all network sockets that represent a full-duplex data stream.
|
inlineexplicit |
|
overridepure virtual |
|
overridevirtual |
Close socket.
Closes the socket. This should flush the output stream.
Implements ISocket.
Reimplemented in SecureSocket, and TCPSocket.
|
pure virtual |
Connect socket.
Attempt to connect to a remote endpoint. This returns immediately and sends a connected event when successful or a connection failed event when it fails. The stream acts as if shutdown for input and output until the stream connects.
Implemented in SecureSocket, and TCPSocket.
|
overridepure virtual |
Flush the stream.
Waits until all buffered data has been written to the stream.
Implements deskflow::IStream.
Implemented in TCPSocket.
|
overridevirtual |
|
overridepure virtual |
Get bytes available to read.
Returns a conservative estimate of the available bytes to read (i.e. a number not greater than the actual number of bytes). Some streams may not be able to determine this and will always return zero.
Implements deskflow::IStream.
Implemented in TCPSocket.
|
pure virtual |
Implemented in SecureSocket, and TCPSocket.
|
overridepure virtual |
Test if read()
will succeed.
Returns true iff an immediate read()
will return data. This may or may not be the same as getSize()
> 0, depending on the stream type.
Implements deskflow::IStream.
Implemented in TCPSocket.
|
overridepure virtual |
Read from stream.
Read up to n
bytes into buffer
, returning the number read (zero if no data is available or input is shutdown). buffer
may be nullptr in which case the data is discarded.
Implements deskflow::IStream.
Implemented in TCPSocket.
|
overridepure virtual |
Shutdown input.
Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0.
Implements deskflow::IStream.
Implemented in TCPSocket.
|
overridepure virtual |
Shutdown output.
Shutdown the output side of the stream. Any buffered output data is discarded and further writes generate output error events. Use flush()
before shutdownOutput()
to send buffered output data.
Implements deskflow::IStream.
Implemented in TCPSocket.
|
overridepure virtual |
Write to stream.
Write n
bytes from buffer
to the stream. If this can't complete immediately it will block. Data may be buffered in order to return more quickly. A output error event is generated when writing fails.
Implements deskflow::IStream.
Implemented in TCPSocket.