|
|
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.
|
Constructor.
Parameters:
_port | the port number to monitor for incoming connections. |
_bind | if false you need to call bindAndListen yourself. This gives you the opportunity to set options on the socket. |
|
Same as above with _bind true.
|
Creates a UNIX domain server socket.
Parameters:
_path | path used for the socket. |
_bind | if false you need to call bindAndListen yourself. This gives you the opportunity to set options on the socket. |
|
Same as above with _bind true.
|
[virtual]
Destructor. Closes the socket if it was not already closed.
bool |
Bind the socket and start listening. This should only be called once when the constructor was called with _bind false.
Returns: true on success. false on error. On error the socket will be closed.
int |
[const]
Get the file descriptor associated with the socket. Returns -1 when an error occured during construction or bindAndListen
unsigned short int |
Returns the port number which is being monitored.
unsigned long |
The address.
void |
[virtual slot]
Called when someone connected to our port.
void |
[signal]
A connection has been accepted. It is your task to delete the KSocket if it is no longer needed.
bool |
[protected: ]
bool |
[protected: ]
QSocketNotifier * |
[protected: ]
int |
[protected: ]
int |
[protected: ]