KServerSocket Class Reference

[kdecore Index] [kdecore Hierarchy] [Headers]


Monitor a port for incoming TCP/IP connections. More...

#include <ksock.h>

Inherits: QObject (qt)

Public Members

Public Slots

Protected Members

Signals


Detailed Description

Monitor a port for incoming TCP/IP connections.

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 dont 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.


KServerSocket( int _port ) [public]

Constructor.

Parameters:
_port the port number to monitor for incoming connections.

KServerSocket( const char *_path ) [public]

Creates a UNIX domain server socket.

~KServerSocket() [public]

Destructor. Closes the socket if it was not already closed.

int socket() const [public]

Get the file descriptor assoziated with the socket.

unsigned short getPort() [public]

Returns the port number which is being monitored.

unsigned long getAddr() [public]

The address.

void slotAccept( int ) [public slot virtual]

Called when someone connected to our port.

QSocketNotifier *notifier[protected]

Notifies us when there is something to read on the port.

int sock[protected]

The file descriptor for this socket. sock may be -1. This indicates that it is not connected.

void accepted( KSocket* ) [signal]

A connection has been accepted. It is your task to delete the KSocket if it is no longer needed.


  • Author: Torben Weis <weis@stud.uni-frankfurt.de>
  • Version: $Id: KServerSocket.html.in,v 1.1.1.1 2000/02/09 22:24:59 tasin Exp $
  • Documentation generated by tasin@cd1 on Die Nov 30 17:31:35 CET 1999
Kdoc