|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jan 2001
Città: Villanova di Guidonia (RM)
Messaggi: 1079
|
[C] select() e ricezione di SIGTERM
Ciao a tutti!
Ho un ciclo strutturato in questo modo: Codice:
...
while(!shutDown){
FD_SET(POP3Socket,&rfds);
FD_SET(SMTPSocket,&rfds);
timeout.tv_sec = 3;
timeout.tv_usec = 0;
selRet=select(nfds,&rfds,NULL,NULL,&timeout);
if (selRet < 0 && errno != EINTR){
PrintError("select() error: ");
}
else if(selRet < 0)
continue;
else if(selRet==0){
FD_SET(POP3Socket,&rfds);
FD_SET(SMTPSocket,&rfds);
timeout.tv_sec = 3;
timeout.tv_usec = 0;
}
else if(FD_ISSET(POP3Socket,&rfds)){
POP3Conn(&pArgs[idx[0]]);
}
else if(FD_ISSET(SMTPSocket,&rfds)){
SMTPConn(&pArgs[idx[1]]);
}
}
LinuxMPShutDown(pArgs);
...
__________________
Intel Core 2 Duo Q6600 G0, 4GB DDR2-800 A-Data, ABIT AB9, XFX GeForce 8800 GTS 320MB, Sound Blaster X-Fi Extreme Music, Seagate 320GB SATA2, Maxtor 80GB ATA-133, Western Digital 1TB SATA2 Ho concluso affari positivamente con: scandalf, Sinclair63, mstella, checcodag, wilson |
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Jan 2001
Città: Villanova di Guidonia (RM)
Messaggi: 1079
|
Scusate ho sbagliato sezione, potete spostarlo in Programmazione? Grazie.
__________________
Intel Core 2 Duo Q6600 G0, 4GB DDR2-800 A-Data, ABIT AB9, XFX GeForce 8800 GTS 320MB, Sound Blaster X-Fi Extreme Music, Seagate 320GB SATA2, Maxtor 80GB ATA-133, Western Digital 1TB SATA2 Ho concluso affari positivamente con: scandalf, Sinclair63, mstella, checcodag, wilson |
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 08:22.


















