Timeout with multithread server


 
Thread Tools Search this Thread
Top Forums Programming Timeout with multithread server
# 1  
Old 04-26-2002
Timeout with multithread server

I wrote a server which creates a thread for every client connection. I have to include timeout function that will kill the server thread if the client doesn't respond for specific time. That too using signal(SIGALRM). For this i am using alarm() function.
When the server thread detects signal it calls the signal handler.
Problem i am facing is that: the signal handler function will be common to all threads. In that case how to do some cleanup functions for perticular server thread? (signal number is the only input to signalhandler)

i hope i explained my problem clearly
if anyone has given a thought on this problem, kindly help me out...
thanks in advance....
# 2  
Old 04-28-2002
Can't you use any other method other than SIGALRM ... like instead of killing the thread, you call the thread to destroy/exit itself?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX 5.3 NFS export not mounting, rpcinfo hang/timeout on server

Been trying to get a directory NFS-mounted with no success. I've tried both NFS v3 and v4, but currently trying v4. I can't figure out what's going on here. server: sbkovwadmd01 sbkovwadmd01# chnfsdom Current local domain: edw.dev sbkovwadmd01# lssrc -a | grep nfs | grep active nfsd ... (3 Replies)
Discussion started by: eckertd
3 Replies

2. AIX

Able to ping the server but not able to login through putty it says network timeout

Able to ping the server but not able to login through putty it says network timeout Please assist (3 Replies)
Discussion started by: Vishal_dba
3 Replies

3. Solaris

Session timeout setting in server

Hi All I need to set timeout of login session of a user if a user is idle for some time. I know the TMOUT setting but it work with only BASH & KORN shell only as I need to set for Bourne shell also. I am trying to put "ClientAliveInterval 300" in sshd_config & restart or refreshing the... (1 Reply)
Discussion started by: sb200
1 Replies

4. IP Networking

TFTP Server Timeout issue

Hi, I'm running CentOS 5 as guest using VMware player. My host is Windows Xp. I'm running tftp server in CentOS. I have disabled firewall in both windows and CentOS. I use two different networks with different netmasks on CentOS. I'm able to ping the Centos (tftp server) from another Linux machine... (1 Reply)
Discussion started by: suryaemlinux
1 Replies

5. Shell Programming and Scripting

Bash script multithread in group of 3

I Have an script like ./bang 1 ./bang 2 ./bang 3 ./bang 4 ./bang 5 ./bang 6 ./bang 7 ./bang 8 ./bang 9 ./bang 10 ./bang 11 ./bang 12 and i wanna execute him in groups of 3 , i mean he execute bang 1 , bang 2 and bang 3 after it finish the next 3 commands it will be executed and... (5 Replies)
Discussion started by: Gyeah11
5 Replies

6. AIX

ftp timeout valiue in AIX 5.3 server !

Dear Friends, I am using AIX 5.3 server . In AIX , I want to increase the timeout value of the ftp service . But I cannot find any configuration file with ftp related in AIX 5.3 server . Would anybody plz tell me , How can I increase the default timeout value in AIX ? (2 Replies)
Discussion started by: shipon_97
2 Replies

7. Programming

[C] Multithread Server

Hi all,i'm new on this forum, excuse me for my english. I have wrote a server that accept connection from multiple client with the fork,but every client had to insert data in a linear list. The problem is that every client insert data in an own copy of the linear list and this is caused by... (7 Replies)
Discussion started by: kemistry
7 Replies

8. Shell Programming and Scripting

SNMP Timeout: No Response from server

When I tried to connect snmp from one server to another server Timeout: No Response from server is comming Pls suggest (0 Replies)
Discussion started by: madhusmita
0 Replies

9. Programming

Multithread app - Read-Only Data

Hello, I'm coding an application using pthreads.At some point the threads will read some read-only variables.Is it safe NOT to use mutexes, in order to make the program lighter since mutex operations are resource-demanding... Thanks (1 Reply)
Discussion started by: jonas.gabriel
1 Replies

10. Programming

Multithread,libcurl

Hi i m codding a programm,it can download any packet from ftp,I use libcurl library. But i want to use threads for downloading.(Multithreading).i cant get ftp file size from ftp and divide packet small pieces,like threads use. Please share your experince with me ,thanks. (0 Replies)
Discussion started by: canerbulut
0 Replies
Login or Register to Ask a Question