LibreOffice Module sd (master) 1
|
[A wrapper for an osl StreamSocket to allow reading lines. More...
#include <BufferedStreamSocket.hxx>
Public Member Functions | |
BufferedStreamSocket (const osl::StreamSocket &aSocket) | |
Create a BufferedStreamSocket on top of an osl::StreamSocket. More... | |
BufferedStreamSocket (int aSocket) | |
Create a BufferedStreamSocket on top of a POSIX or WinSock socket. More... | |
BufferedStreamSocket (const BufferedStreamSocket &aSocket) | |
~BufferedStreamSocket () | |
virtual sal_Int32 | readLine (OString &aLine) override |
Blocks until a line is read. More... | |
virtual sal_Int32 | write (const void *pBuffer, sal_uInt32 n) override |
Write a number of bytes. More... | |
virtual void | close () override |
void | getPeerAddr (osl::SocketAddr &) |
Public Member Functions inherited from sd::IBluetoothSocket | |
IBluetoothSocket ()=default | |
virtual | ~IBluetoothSocket () |
IBluetoothSocket (const IBluetoothSocket &)=delete | |
IBluetoothSocket & | operator= (const IBluetoothSocket &)=delete |
virtual sal_Int32 | readLine (OString &aLine)=0 |
Blocks until a line is read. More... | |
virtual sal_Int32 | write (const void *pBuffer, sal_uInt32 n)=0 |
Write a number of bytes. More... | |
virtual void | close () |
Private Attributes | |
sal_Int32 | aRet |
sal_Int32 | aRead |
std::vector< char > | aBuffer |
int | mSocket |
bool | usingCSocket |
[A wrapper for an osl StreamSocket to allow reading lines.
]
Currently wraps either an osl StreamSocket or a standard c socket, allowing reading and writing for our purposes. Should eventually be returned to being a StreamSocket wrapper if/when Bluetooth is integrated into osl Sockets.
Definition at line 28 of file BufferedStreamSocket.hxx.
|
explicit |
Create a BufferedStreamSocket on top of an osl::StreamSocket.
Definition at line 29 of file BufferedStreamSocket.cxx.
|
explicit |
Create a BufferedStreamSocket on top of a POSIX or WinSock socket.
Definition at line 38 of file BufferedStreamSocket.cxx.
sd::BufferedStreamSocket::BufferedStreamSocket | ( | const BufferedStreamSocket & | aSocket | ) |
BufferedStreamSocket::~BufferedStreamSocket | ( | ) |
Definition at line 46 of file BufferedStreamSocket.cxx.
References close().
|
overridevirtual |
Reimplemented from sd::IBluetoothSocket.
Definition at line 71 of file BufferedStreamSocket.cxx.
References close(), mSocket, and usingCSocket.
Referenced by close(), and ~BufferedStreamSocket().
void BufferedStreamSocket::getPeerAddr | ( | osl::SocketAddr & | rAddr | ) |
Definition at line 50 of file BufferedStreamSocket.cxx.
References usingCSocket.
Referenced by sd::RemoteServer::handleAcceptedConnection().
|
overridevirtual |
Blocks until a line is read.
Returns whatever the last call of recv returned, i.e. 0 or less if there was a problem in communications.
Implements sd::IBluetoothSocket.
Definition at line 86 of file BufferedStreamSocket.cxx.
References aBuffer, aRead, aRet, find(), MAX_LINE_LENGTH, mSocket, SAL_INFO, and usingCSocket.
Referenced by sd::RemoteServer::handleAcceptedConnection().
|
overridevirtual |
Write a number of bytes.
Implements sd::IBluetoothSocket.
Definition at line 56 of file BufferedStreamSocket.cxx.
References mSocket, n, and usingCSocket.
Referenced by sd::RemoteServer::handleAcceptedConnection().
|
private |
Definition at line 60 of file BufferedStreamSocket.hxx.
Referenced by readLine().
|
private |
Definition at line 59 of file BufferedStreamSocket.hxx.
Referenced by readLine().
|
private |
Definition at line 59 of file BufferedStreamSocket.hxx.
Referenced by readLine().
|
private |
Definition at line 61 of file BufferedStreamSocket.hxx.
Referenced by close(), readLine(), and write().
|
private |
Definition at line 62 of file BufferedStreamSocket.hxx.
Referenced by close(), getPeerAddr(), readLine(), and write().