class KLocalSocket |
|
KLocalSocket
KLocalSocket allows one to create and use local (Unix) sockets
On some platforms, local sockets are a kind of streaming socket that can be used to transmit and receive data just like Internet (TCP) streaming sockets. The difference is that they remain local to the host running them and cannot be accessed externally. They are also very fast and (in theory) consume less resources than standard TCP sockets. KLocalSocket supports two kinds of local socket types (see KLocalSocket.LocalSocketType): - Unix sockets (UnixSocket): standard Unix sockets whose names are file paths and obey filesystem restrictions - Abstract Unix sockets (AbstractUnixSocket): similar to Unix sockets, but they don't exist as entries in the filesystem and, thus, aren't restricted by its permissions
Author Thiago Macieira |
|
Creates a KLocalSocket object with parent as the parent
object.
parent - the parent object |
|
|
|
Internal |
|
Opens a connection to a listening Unix socket at path. Use
waitForConnection() to find out if the connection succeeded or
not.
path - the Unix socket to connect to mode - the mode to use when opening (see QIODevice.OpenMode) |
|
Opens a connection to a listening local socket at address @p
path. Use waitForConnection() to find out if the connection
succeeded or not.
path - the local socket address to connect to type - the local socket type to use mode - the mode to use when opening (see QIODevice.OpenMode) |
|
|
Disconnects the socket from its server. |
|
Returns the local address of this socket, when
connected. Returns QString() if not connected.
Most of the time, the socket has no local address. |
|
Returns the socket type for this socket, when connected. Returns UnknownLocalSocketType if not connected. |
|
Returns the peer address of this socket. That is, the address that this socket connected to (see connectToPath). Returns QString() if not connected. |
Defines the local socket type. See KLocalSocket for more information
UnixSocket | - | - | ||
AbstractUnixSocket | - | - | ||
UnknownLocalSocketType | - -1 | - |