long time and no answer! Is this forum alive?!!!
Type: Posts; User: hosseinyounesi
long time and no answer! Is this forum alive?!!!
long time and no answer! Is this forum alive?!!!
Hi,
I'm using sockets for communication. Everything works fine but when i use netstat on server,
There are many connections with "TIME_WAIT" state and are increasing! I shutdown and close the...
Hi,
I'm using sockets for communication. Everything works fine but when i use netstat on server,
There are many connections with "TIME_WAIT" state and are increasing! I shutdown and close the...
Hi,
I used flock and it is working now :D
flock(2) - Linux man page
int fd=open(LOCK_FILE, O_RDWR|O_CREAT,0640);
if (fd<0)
cout << "Could not open lockfile" << endl;
...
What's this?!
With the code I posted, two execution of the program can be executed and the lockf return 0 for each of them!!!
"unique" library?! What do you mean?! It's a C library or ... ?!
There is no compile error, but two or more instance of the program can still be executed at the same time (simultaneously) :(
Hi,
I'm writing a daemon and now that must be run in a single process (two instance of process should not be executed at the same time). I tried this code, but it didn't work:
int...
This is what I tried, and it is working now :)
read:
fd_set rfds;
int res=0;
int retval;
struct timeval tv;
//////////////////
Thanks, But my question is: When I use fork and the exec in child process, the parent will not be "zombie" although the child is terminated. WHY ?
(As you know, If a child terminates before...
You are right. Another question: If a child process terminate before the parent, after a few time the parent will be a "Zombie" process. And we know that "exec(newProcess)" family system calls,...
Hi everyone, At last I found it :cool: "/proc/net/dev" is what I need. This file consists of some counters for each interface, each one counts the number of packets (and bytes). ifconfig uses this...
I know what is "google" !!!!!! I hope that you are joking :) I just thought that maybe someone has did this before :(
I will report my attempt here about libpcap and ifstat or ...
Thanks again
yes, but isn't there any function or library that can be used in C or C++ ?!
Thanks, But I think that you don't understand my question! I said that I've used "GetIfTable" to collect information in windows. I introduced ifstat, ...
By the way, Excuse me if I didn't ask my...
I need the send/receive of each interfaces :cool:
Thanks,
I mean that I have to write a software and I need to get nic traffic!!! Clear?
But what the code you've written is ?!!!! :(
Thanks,
I have to use a program to do that!!! What is "ifstat" ?!
Hi,
I want to get send/receive of my PC NICs in Linux?! For windows I can use "GetIfTable" and process the output. And about linux?! UI have to install some software ?!
Thanks everyone
this can be a way. But the forked process name is not the executed application name!!! It's name is the process name that calls fork? Am I right? How to fix this?
Thanks anyone
I'm going to be disappointed :(
But I think using a blocking read after successful nonblocking read will do my job!
Another question: After closing my program, will the pipe file be deleted? I...
I wrote the program to 'write' on the read program you wrote. But some times the write program fails on write and read program sometimes crashes on open or read. Also, you haven't used 'select'...
Thanks a lot, I'm gonna test it and I will report the result here :)
Thanks, would you mind give me an example or use select in the program I wrote in the first post?