KDECore
KServerSocket Class Reference
Monitors a port for incoming TCP/IP connections. More...
#include <ksock.h>
Inheritance diagram for KServerSocket:

Public Slots | |
| virtual void | slotAccept (int) |
Signals | |
| void | accepted (KSocket *s) |
Public Member Functions | |
| bool | bindAndListen () |
| KServerSocket (const char *_path, bool _bind=true) | |
| KServerSocket (unsigned short int _port, bool _bind=true) | |
| unsigned short int | port () |
| int | socket () const |
| virtual | ~KServerSocket () |
Protected Member Functions | |
| bool | init (const char *_path) |
| bool | init (unsigned short int) |
Protected Attributes | |
| int | sock |
Detailed Description
Monitors a port for incoming TCP/IP connections.
- Deprecated:
- This class is deprecated and will be removed in the future. Please use the classes in KNetwork for new programs. In special, this class is replaced by KNetwork::KStreamSocket and KNetwork::KServerSocket.
If socket() is -1 or less the socket was not created properly.
Definition at line 250 of file ksock.h.
Constructor & Destructor Documentation
| KServerSocket::KServerSocket | ( | unsigned short int | _port, | |
| bool | _bind = true | |||
| ) |
| KServerSocket::KServerSocket | ( | const char * | _path, | |
| bool | _bind = true | |||
| ) |
| KServerSocket::~KServerSocket | ( | ) | [virtual] |
Member Function Documentation
| void KServerSocket::accepted | ( | KSocket * | s | ) | [signal] |
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.
- Parameters:
-
s the socket that accepted
| bool KServerSocket::bindAndListen | ( | ) |
| bool KServerSocket::init | ( | const char * | _path | ) | [protected] |
| bool KServerSocket::init | ( | unsigned short int | _port | ) | [protected] |
| unsigned short int KServerSocket::port | ( | ) |
| void KServerSocket::slotAccept | ( | int | ) | [virtual, slot] |
| int KServerSocket::socket | ( | ) | const [inline] |
Member Data Documentation
int KServerSocket::sock [protected] |
The documentation for this class was generated from the following files:
KDE 3.5 API Reference