KServerSocket Class Reference
#include <ksock.h>
Inheritance diagram for KServerSocket:

Detailed Description
Monitors a port for incoming TCP/IP connections.
- Deprecated:
- This class is deprecated and will be removed in the future.
You can use a KServerSocket to listen on a port for incoming connections. When a connection arrived in the port, a KSocket is created and the signal accepted is raised. Make sure you always connect to this signal. If you don't the ServerSocket will create new KSocket's and no one will delete them!
If socket() is -1 or less the socket was not created properly.
- Author:
- Torben Weis <weis@stud.uni-frankfurt.de>
Definition at line 250 of file ksock.h.
Public Slots | |
virtual void | slotAccept (int) |
Signals | |
void | accepted (KSocket *s) |
Public Member Functions | |
KServerSocket (unsigned short int _port, bool _bind=true) | |
KServerSocket (const char *_path, bool _bind=true) | |
virtual | ~KServerSocket () |
bool | bindAndListen () |
int | socket () const |
unsigned short int | port () |
Protected Member Functions | |
bool | init (unsigned short int) |
bool | init (const char *_path) |
Protected Attributes | |
int | sock |
Constructor & Destructor Documentation
|
Constructor.
|
|
Creates a UNIX domain server socket.
|
|
Destructor. Closes the socket if it was not already closed. |
Member Function Documentation
|
A connection has been accepted. It is your task to delete the KSocket if it is no longer needed. WARNING: this signal is always emitted, even if you don't connect anything to it. That would mean memory loss, because the KSockets created go to oblivion.
|
|
Binds the socket and start listening. This should only be called once when the constructor was called with _bind false. On error the socket will be closed.
|
|
Returns the port number which is being monitored.
|
|
Called when someone connected to our port.
|
|
Returns the file descriptor associated with the socket.
|
Member Data Documentation
|
The file descriptor for this socket. sock may be -1. This indicates that it is not connected. |
The documentation for this class was generated from the following files: