lunp
|
Contiene i wrapper delle funzioni per i server con socket connessi TCP. Continua...
Vai al codice sorgente di questo file.
Ridefinizioni di tipo (typedef) | |
typedef void(* | myTcpServerChildTask )(SOCKET sockfd) |
La funzione che viene chiamata dalle funzioni myTcpServerXxx ogni volta che un client si connette al server. Continua... | |
typedef bool(* | myTcpServerSelectChildTask )(SOCKET sockfd) |
La funzione che viene chiamata dalla funzione myTcpServerSelect ogni volta che un client si connette al server. Continua... | |
Funzioni | |
SOCKET | myTcpServerAccept (SOCKET sockfd, struct sockaddr_in *clientStruct) |
Accetta una connessione sul socket TCP specificato. Continua... | |
SOCKET | myTcpServerStartup (const char *serverPort) |
Crea un socket TCP associato alla porta specificata. Continua... | |
void | myTcpServerSimple (SOCKET sockfd, myTcpServerChildTask childTask) |
Implementa un server TCP che serve un client per volta. Continua... | |
void | myTcpServerOCPC (SOCKET sockfd, myTcpServerChildTask childTask) |
Implementa un server TCP che serve più client tramite il fork di più processi figlio, uno per client. Continua... | |
void | myTcpServerOCPCMax (SOCKET sockfd, int maxChildCount, myTcpServerChildTask childTask) |
Implementa un server TCP che serve fino a maxChildCount client tramite il fork di più processi figlio, uno per client. Continua... | |
void | myTcpServerPreforked (SOCKET sockfd, int childCount, myTcpServerChildTask childTask) |
Implementa un server TCP che serve fino a childCount client tramite il pre-fork di childCount processi figlio. Continua... | |
void | myTcpServerMixed (SOCKET sockfd, int minChildCount, myTcpServerChildTask childTask) |
Implementa un server TCP che serve più client tramite il pre-fork di minChildCount processi figlio. Continua... | |
void | myTcpServerMixedMax (SOCKET sockfd, int minChildCount, int maxChildCount, myTcpServerChildTask childTask) |
Implementa un server TCP che serve fino a maxChildCount client tramite il pre-fork di minChildCount processi figlio. Continua... | |
void | myTcpServerSelect (SOCKET sockfd, int maxChildCount, myTcpServerSelectChildTask childTask) |
Implementa un server TCP che serve fino a maxChildCount client nello stesso processo. Continua... | |
Contiene i wrapper delle funzioni per i server con socket connessi TCP.
typedef void(* myTcpServerChildTask)(SOCKET sockfd) |
La funzione che viene chiamata dalle funzioni myTcpServerXxx
ogni volta che un client si connette al server.
sockfd | Il file descriptor del socket a cui il client da servire è conesso. |
La funzione che viene chiamata dalla funzione myTcpServerSelect
ogni volta che un client si connette al server.
sockfd | Il file descriptor del socket a cui il client da servire è conesso. |
Accetta una connessione sul socket TCP specificato.
sockfd | Il file descriptor del socket TCP su cui accettare la connessione. |
clientStruct | La struttura contenente le informazioni sul client. |
void myTcpServerMixed | ( | SOCKET | sockfd, |
int | minChildCount, | ||
myTcpServerChildTask | childTask | ||
) |
Implementa un server TCP che serve più client tramite il pre-fork di minChildCount
processi figlio.
sockfd | Il file descriptor del socket a cui i client si connettono. |
minChildCount | Il numero minimo di processi figlio generati con il pre-fork. |
childTask | La funzione da chiamare ogni volta che un client si connette al socket sockfd . |
void myTcpServerMixedMax | ( | SOCKET | sockfd, |
int | minChildCount, | ||
int | maxChildCount, | ||
myTcpServerChildTask | childTask | ||
) |
Implementa un server TCP che serve fino a maxChildCount
client tramite il pre-fork di minChildCount
processi figlio.
sockfd | Il file descriptor del socket a cui i client si connettono. |
minChildCount | Il numero minimo di processi figlio generati con il pre-fork. |
maxChildCount | 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 myTcpServerOCPC | ( | SOCKET | sockfd, |
myTcpServerChildTask | childTask | ||
) |
Implementa un server TCP che serve più client tramite il fork di più processi figlio, uno per client.
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 . |
void myTcpServerOCPCMax | ( | SOCKET | sockfd, |
int | maxChildCount, | ||
myTcpServerChildTask | childTask | ||
) |
Implementa un server TCP che serve fino a maxChildCount
client tramite il fork di più processi figlio, uno per client.
sockfd | Il file descriptor del socket a cui i client si connettono. |
maxChildCount | 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 myTcpServerPreforked | ( | SOCKET | sockfd, |
int | childCount, | ||
myTcpServerChildTask | childTask | ||
) |
Implementa un server TCP 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 myTcpServerSelect | ( | SOCKET | sockfd, |
int | maxChildCount, | ||
myTcpServerSelectChildTask | childTask | ||
) |
Implementa un server TCP che serve fino a maxChildCount
client nello stesso processo.
sockfd | Il file descriptor del socket a cui i client si connettono. |
maxChildCount | 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 myTcpServerSimple | ( | SOCKET | sockfd, |
myTcpServerChildTask | childTask | ||
) |
Implementa un server TCP 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 myTcpServerStartup | ( | const char * | serverPort | ) |
Crea un socket TCP associato alla porta specificata.
serverPort | La porta del server a cui associare il socket creato. |