![]() |
Deskflow 1.26.0.418
Keyboard and mouse sharing utility
|
TCP data socket. More...
#include <TCPSocket.h>


Public Member Functions | |
| TCPSocket (IEventQueue *events, SocketMultiplexer *socketMultiplexer, IArchNetwork::AddressFamily family=IArchNetwork::AddressFamily::INet) | |
| TCPSocket (IEventQueue *events, SocketMultiplexer *socketMultiplexer, ArchSocket socket) | |
| TCPSocket (TCPSocket const &)=delete | |
| TCPSocket (TCPSocket &&)=delete | |
| ~TCPSocket () override | |
| TCPSocket & | operator= (TCPSocket const &)=delete |
| TCPSocket & | operator= (TCPSocket &&)=delete |
| void | bind (const NetworkAddress &) override |
| 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 |
| Read from stream. | |
| void | write (const void *buffer, uint32_t n) override |
| Write to stream. | |
| void | flush () override |
| Flush the stream. | |
| void | shutdownInput () override |
| Shutdown input. | |
| void | shutdownOutput () override |
| Shutdown output. | |
| bool | isReady () const override |
Test if read() will succeed. | |
| bool | isFatal () const override |
| uint32_t | getSize () const override |
| Get bytes available to read. | |
| void | connect (const NetworkAddress &) override |
| Connect socket. | |
| virtual ISocketMultiplexerJob * | newJob () |
| Public Member Functions inherited from IDataSocket | |
| IDataSocket (const IEventQueue *events) | |
| Public Member Functions inherited from ISocket | |
| virtual | ~ISocket ()=default |
| Public Member Functions inherited from deskflow::IStream | |
| IStream ()=default | |
| virtual | ~IStream ()=default |
Protected Types | |
| enum class | JobResult { Break = -1 , Retry , New } |
Protected Member Functions | |
| ArchSocket | getSocket () |
| IEventQueue * | getEvents () |
| virtual JobResult | doRead () |
| virtual JobResult | doWrite () |
| void | setJob (ISocketMultiplexerJob *) |
| bool | isConnected () const |
| void | setConnected (bool connected) |
| bool | isReadable () const |
| void | setReadable (bool readable) |
| bool | isWritable () const |
| void | setWritable (bool canWrite) |
| Mutex & | getMutex () |
| void | sendEvent (EventTypes) |
| void | discardWrittenData (int bytesWrote) |
Protected Attributes | |
| StreamBuffer | m_inputBuffer |
| StreamBuffer | m_outputBuffer |
TCP data socket.
A data socket using TCP.
|
strongprotected |
| TCPSocket::TCPSocket | ( | IEventQueue * | events, |
| SocketMultiplexer * | socketMultiplexer, | ||
| IArchNetwork::AddressFamily | family = IArchNetwork::AddressFamily::INet ) |
| TCPSocket::TCPSocket | ( | IEventQueue * | events, |
| SocketMultiplexer * | socketMultiplexer, | ||
| ArchSocket | socket ) |
|
delete |
|
delete |
|
override |
|
overridevirtual |
|
overridevirtual |
Close socket.
Closes the socket. This should flush the output stream.
Reimplemented from IDataSocket.
|
overridevirtual |
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.
Implements IDataSocket.
|
protected |
|
protectedvirtual |
Reimplemented in SecureSocket.
|
protectedvirtual |
Reimplemented in SecureSocket.
|
overridevirtual |
Flush the stream.
Waits until all buffered data has been written to the stream.
Implements deskflow::IStream.
|
inlineprotected |
|
overridevirtual |
Get event target.
Returns the event target for events generated by this socket.
Reimplemented from IDataSocket.
|
inlineprotected |
|
overridevirtual |
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.
|
inlineprotected |
|
inlineprotected |
|
overridevirtual |
Implements IDataSocket.
|
inlineprotected |
|
overridevirtual |
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.
|
inlineprotected |
|
virtual |
Reimplemented in SecureSocket.
|
overridevirtual |
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.
|
protected |
|
inlineprotected |
|
protected |
|
inlineprotected |
|
inlineprotected |
|
overridevirtual |
Shutdown input.
Shutdown the input side of the stream. Any pending input data is discarded and further reads immediately return 0.
Implements deskflow::IStream.
|
overridevirtual |
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.
|
overridevirtual |
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.
|
protected |
|
protected |