class KServerSocket

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

Definition#include <ksock.h>
InheritsQObject (qt)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

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 )

Constructor.

Parameters:
_portthe port number to monitor for incoming connections.

KServerSocket ( const char *_path )

Creates a UNIX domain server socket.

~KServerSocket ()

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

int socket ()
[const]

Get the file descriptor assoziated with the socket.

unsigned short getPort ()

Returns the port number which is being monitored.

unsigned long getAddr ()

The address.

void slotAccept ( int )
[virtual slot]

Called when someone connected to our port.

void accepted ( KSocket* )
[signal]

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

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.