#include "ktypes.h"
#include "KSocket.h"
Typedefs | |
| typedef _KServerSocket | KServerSocket |
| KServerSocket structure. | |
| typedef void( | kfunc_ss_newsocket )(KPtr) |
| The functions called at server connexion. | |
Enumerations | |
| enum | ESSRet { KSS_RET_UNKNOWN_ERROR, KSS_RET_SUCCESS, KSS_RET_BAD_PARAMETERS, KSS_RET_NO_WAIT_CONNEXION, KSS_RET_ALREADY_LISTENING } |
| Return codes. More... | |
Functions | |
| KTL_API KServerSocket * | KServerSocket_new () |
| Allocates a KServerSocket structure. | |
| KTL_API void | KServerSocket_delete (KServerSocket **pServer) |
| Deletes a KServerSocket structure. | |
| KTL_API ESSRet | KServerSocket_setMaxConnexion (KServerSocket *pServer, KUInt16 iMaxConn) |
| Defines the maximum number of connexion. | |
| KTL_API ESSRet | KServerSocket_listen (KServerSocket *pServer, KUInt16 iPort) |
| Starts the listening of the connexion on a given port. This function is nonblocking. | |
| KTL_API ESSRet | KServerSocket_stopListening (KServerSocket *pServer) |
| Stops the listening of connexions. | |
| KTL_API KBool | KServerSocket_isListening (KServerSocket *pServer) |
| Indicates if a socket is in listening mode. | |
| KTL_API ESSRet | KServerSocket_accept (KServerSocket *pServer, KSocket **pSocket) |
| Accepts a server connexion. Removes the demand of the connexion list and allows a new connexion request. This is a nonblocking function. | |
| KTL_API ESSRet | KServerSocket_setFuncNewSocket (KServerSocket *pServer, kfunc_ss_newsocket *fNewSocket, KPtr pUserData) |
| Defines a function called at each accepted connexion. | |
|
|
The functions called at server connexion.
|
|
|
Return codes.
|
|
||||||||||||
|
Accepts a server connexion. Removes the demand of the connexion list and allows a new connexion request. This is a nonblocking function.
|
|
|
Deletes a KServerSocket structure.
|
|
|
Indicates if a socket is in listening mode.
|
|
||||||||||||
|
Starts the listening of the connexion on a given port. This function is nonblocking.
|
|
|
Allocates a KServerSocket structure.
|
|
||||||||||||||||
|
Defines a function called at each accepted connexion.
|
|
||||||||||||
|
Defines the maximum number of connexion.
|
|
|
Stops the listening of connexions.
|
1.3.8