Socket communication and timer application


 
Thread Tools Search this Thread
Operating Systems Linux Socket communication and timer application
# 1  
Old 06-07-2008
Socket communication and timer application

tcp communication application
i have an application which run in

1)
while()
{in

}
and listens for some request
When a request comes to create a file(containing some data fetch from somewhere)
but i also want to start some timer that after 10/20 min delete that file
But i don't know how to create such timer

2)
Also
now i want to open listening socket (with some other application).this socket will continue listening for alarms send by that application and forward it to other application

but this should not be blocking as the alarm comes it should forward it . this should not be blocking because it will block the other portion of code until and unless it recieves alarm

I read about select . Can it be used in this scenario

It will be great if some body helps me out
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Application with communication between process

Hello I would like to create an application with communication between processes, application tightly coupled, have you please an idea about an API or a tool that allows me to generate such application? Thank you so much (11 Replies)
Discussion started by: chercheur857
11 Replies

2. UNIX and Linux Applications

Timer application in linux

Hello everyone, It is good to be here. I am a newbie to Linux.Can anyone help me in designing a timer application. The timer has to start.And after certain time interval the program should call a function continuously.It should not be in sleep mode.During the course of that time interval the... (0 Replies)
Discussion started by: Harry443
0 Replies

3. Programming

Client/Server Socket Application - Preventing Client from quitting on server crash

Problem - Linux Client/Server Socket Application: Preventing Client from quitting on server crash Hi, I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64. I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies

4. Programming

socket system call can not succedd right after application crash.

hello all, I have developed a server application in C for ulinux kernel 2.6.It works very fine; creating a socket, binding it to a port, listening for incoming sockets and accepting them ,all finish without any error. But there is a problem regarding application crash.After an intentionally... (1 Reply)
Discussion started by: Sedighzadeh
1 Replies

5. UNIX for Dummies Questions & Answers

socket programming using udp for chat application

hi, i have a source code for 1 server and 2 clients ...but the clients are not able to send data..1 server only receives data from clients and forwards to any other client, the data is in the buffer.....please help... thank you in advance..... /**********client1***************/ // Here Data... (1 Reply)
Discussion started by: unsweety
1 Replies

6. UNIX for Dummies Questions & Answers

socket communication and timer application

i need to develop application which continuously wait for a request from multiple host and on receiving a request on that need to create a log file and after 30 mins delete that file I am new to socket programming so could anyone help me on this. How to continuously listen for a request How... (0 Replies)
Discussion started by: tryit
0 Replies

7. Linux

segmentation fault in socket application

helo, i m using linux operationg system at both client and server side. Now in my application when i use ntohl() then it will give segmentation fault. now when i remove nothl(), then it works fine. can u tell me why this happen. amit (8 Replies)
Discussion started by: amitpansuria
8 Replies

8. Programming

socket communication but not writing

hello, when i execute my code server side it connects with the client and when i try to write through the server into the client the program exits. i could not understand whether it is the problem with the server or with the client.The Protocol is TCP/IP. thanking you. (2 Replies)
Discussion started by: madfox
2 Replies

9. UNIX for Dummies Questions & Answers

Which application has a TCP socket open

If I do a netstat -a I can see all the sockets currently open, is there a way that I can tell which application is holding open these sockets ? (3 Replies)
Discussion started by: murphyboy
3 Replies

10. Programming

ftp application using socket programming

i have made a ftp application in socket programming which uses TCP/IP .. i have the problem runing the only problem is on the client side i take the user input for the file to be downloaded from the command promt. write(s, argv, strlen(argv)+1); // this is how i write in client side argv is... (1 Reply)
Discussion started by: toughguy2handle
1 Replies
Login or Register to Ask a Question
SDL_SetTimer(3) 						 SDL API Reference						   SDL_SetTimer(3)

NAME
SDL_SetTimer - Set a callback to run after the specified number of milliseconds has elapsed. SYNOPSIS
#include "SDL.h" int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); CALLBACK
/* Function prototype for the timer callback function */ typedef Uint32 (*SDL_TimerCallback)(Uint32 interval); DESCRIPTION
Set a callback to run after the specified number of milliseconds has elapsed. The callback function is passed the current timer interval and returns the next timer interval. If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled. To cancel a currently running timer, call SDL_SetTimer(0, NULL); The timer callback function may run in a different thread than your main constant, and so shouldn't call any functions from within itself. The maximum resolution of this timer is 10 ms, which means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below). If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). Note: This function is kept for compatibility but has been superseded by the new timer functions SDL_AddTimer and SDL_RemoveTimer which support multiple timers. EXAMPLES
SDL_SetTimer((33/10)*10, my_callback); SEE ALSO
SDL_AddTimer SDL
Tue 11 Sep 2001, 23:01 SDL_SetTimer(3)