lunp
|
Contiene i wrapper delle funzioni per i server con socket non connessi UDP. Continua...
Vai al codice sorgente di questo file.
Ridefinizioni di tipo (typedef) | |
typedef void(* | myUdpServerChildTask )(SOCKET sockfd) |
La funzione che viene chiamata dalle funzioni myUdpServerXxx ogni volta che un client si connette al server. Continua... | |
Funzioni | |
SOCKET | myUdpServerStartup (const char *serverPort) |
Crea un socket UDP associato alla porta specificata. Continua... | |
void | myUdpServerSimple (SOCKET sockfd, myUdpServerChildTask childTask) |
Implementa un server UDP che serve un client per volta. Continua... | |
void | myUdpServerPreforked (SOCKET sockfd, int childCount, myUdpServerChildTask childTask) |
Implementa un server UDP che serve fino a childCount client tramite il pre-fork di childCount processi figlio. Continua... | |
bool | myUdpLimitClients (struct sockaddr_in clientStruct, int maxDatagrams, int maxClients) |
Verifica che non siano stati ricevuti più di maxDatagrams datagrammi dal client clientStruct . Continua... | |
Contiene i wrapper delle funzioni per i server con socket non connessi UDP.
typedef void(* myUdpServerChildTask)(SOCKET sockfd) |
La funzione che viene chiamata dalle funzioni myUdpServerXxx
ogni volta che un client si connette al server.
sockfd | Il file descriptor del socket a cui il client da servire è conesso. |
bool myUdpLimitClients | ( | struct sockaddr_in | clientStruct, |
int | maxDatagrams, | ||
int | maxClients | ||
) |
Verifica che non siano stati ricevuti più di maxDatagrams
datagrammi dal client clientStruct
.
clientStruct | La struttura contenente le informazioni sul client da cui i dati sono stati ricevuti. |
maxDatagrams | Il numero massimo di datagrammi che può essere ricevuto dal client clientStruct . |
maxClients | Il numero massimo di client da riconoscere. |
maxDatagrams
datagrammi dal client clientStruct
, altrimenti restituisce true. void myUdpServerPreforked | ( | SOCKET | sockfd, |
int | childCount, | ||
myUdpServerChildTask | childTask | ||
) |
Implementa un server UDP che serve fino a childCount
client tramite il pre-fork di childCount
processi figlio.
sockfd | Il file descriptor del socket a cui i client si connettono. |
childCount | Il numero massimo di client da servire allo stesso tempo. |
childTask | La funzione da chiamare ogni volta che un client si connette al socket sockfd . |
void myUdpServerSimple | ( | SOCKET | sockfd, |
myUdpServerChildTask | childTask | ||
) |
Implementa un server UDP che serve un client per volta.
sockfd | Il file descriptor del socket a cui i client si connettono. |
childTask | La funzione da chiamare ogni volta che un client si connette al socket sockfd . |
SOCKET myUdpServerStartup | ( | const char * | serverPort | ) |
Crea un socket UDP associato alla porta specificata.
serverPort | La porta del server a cui associare il socket creato. |