Programming :: Set Period Of Time To Tcp Connection To Wait For Request Or Respond For Tcp Block Read

Feb 27, 2010

I wanted to know how can I set a period of time to a tcp connection to wait for request or respond for tcp block read. which system call or function I can use? Does any body know a very simple quick and easy reference on web for socket programing that has lots of socket programing examples in it?

View 1 Replies


ADVERTISEMENT

Programming :: Timer In Socket Programming - Wait For X Sec After Read() And Then Disconnect The Client Connection

Mar 8, 2011

I have a server listening on incoming client connections. Once the client establishes SSL connection with the server, the server waits on read() from the client. Only Client can disconnect the connection. I want to have a timer in the server program to wait for x secs after read() and then disconnect the Client connection.

View 3 Replies View Related

OpenSUSE Network :: Block A Site For A Certain Time Period?

Dec 6, 2010

I'm trying to block a site for a certain time.How to Block(deny) perticuler website in certain times of the day , by using squid ? and it seemed promising.I added the lines to my squid.conf

acl office_time time MTWHF 3:00-21:00
acl bad url_regex "/etc/squid/block.acl
http_access deny bad !office_time

created a block.acl in the same directory and restarted it.

View 2 Replies View Related

OpenSUSE Network :: Internet Connection Dies After A Period Of Time

Feb 22, 2011

I am having some trouble with my opensuse 11.3 internet connection for two weeks. After a certain period connection drops while using both NetworkManager and ifup. For info, I write the outputs of some codes.

[Code]...

View 2 Replies View Related

Programming :: Read From Stdin In Perl Do Not Wait For EOF?

Apr 28, 2010

I am trying to read one line at a time in perl and not wait for stdin eof to start the action:

Code:
foreach(<STDIN>){
<do something>
}

if i pipe ls into it, it waits for ls to be done before doing the action.

View 1 Replies View Related

Programming :: Shell Script: Wait On Two Processes At The Same Time?

Mar 16, 2010

I'm writing a script that needs to spawn 2 or more processes and wait for their return status. I have a method to do this by waiting on each process individually like this:

Code:
process1 &
PID1=$!

[code]...

View 14 Replies View Related

General :: Would Nameserver1 Never Respond To DNS Request?

Jul 19, 2011

Say if i have a domain and i changed the registrar from nameserver1 to nameserver2.For example, if a client side cache isn't cleared, and if the client requests DNS query, would it be possible for the old nameserver1 to respond to the query? would nameserver1 never respond to DNS request?

View 1 Replies View Related

Programming :: Read Keyboard Status (not: Wait For Keyboard Input)?

Jun 28, 2011

has bash a command that reads the keyboard status and exits? I want to write a loop of this form:

Code:
while [ 1 ] do
sleep (1)

[code]....

View 14 Replies View Related

Programming :: Algorithm - File System Block Number For Immediate Read

May 20, 2010

algorithm:breada
input: file system block number for immediate read
file system block number for asynchronous read
output:buffer containing data for immediate read {
if(first block not in cache) {
get buffer for first block
if(buffer data not valid)
initiate disk read }
if(second block not in cache) {
get buffer for second block)
if(buffer data valid) //line 1
release buffer else
initiate disk read //line 2 }
if(first block was originally in cache) //line 3 {
read first block
return buffer }
sleep (event first buffer contains valid data)
return buffer }

Here is an algorithm for block read algorithm. I have problem in
line 1: If buffer data is valid why is it releasing the buffer?
line 2: If buffer data valid why is it initiating disk read. It should have read directly from buffer?
line 3: It should be the first condition as if it is there in cache then it should return it without delay?

View 5 Replies View Related

Programming :: Measure CPU Time Spent On A Code Block (with C Or C++)?

Jul 31, 2011

I have a C program like this:

...
CODE_BLOCK;
...

I want to know how much CPU time spent on CODE_BLOCK. Since the process executing CODE_BLOCK may be preempted during execution, this CPU time may not be equal to the (wall-clock) time elapsed from the beginning of CODE_BLOCK to the end of it.

View 3 Replies View Related

Programming :: Read In A File 1 Line At A Time?

Oct 22, 2010

i am trying to read in a file 1 line at a time and for some reason it stops printing out at about line 62,000.

i am doing this:
Code:
while(fgets(c0, 1085, fstream0) != NULL)

but after about 62,0000 lines it stops printing. no seg-fault, no core dump. it just stops printing to the terminal then returns me to the command line after a couple of minutes. as a hack i am doing split -l 50000 on the input and calling my program 5 times.is there some limitation on fgets that i am not understanding ?

View 8 Replies View Related

Ubuntu :: Freezes After A Period Of Inactive Time?

Dec 16, 2010

I installed ubuntu 10.0.4 TLS version and my desktop freezes after a period of inactive time: the screen doesn't change and the apps do not response. It will resume after any key-stroke or mouse action. Is it a feature of 'power-saving' or something else? I need my ubuntu keep 'alive' all the time.

View 2 Replies View Related

General :: Calculate Time Period In Scripting

Mar 16, 2011

Now i am writting one bash script. in that my requirement is i need to create one directory and that the directory details to be stored in one file Ex. date/time and all in one file. after that i need to delete the folder automatically exactly after 3months. between these time period in 2month itself i need to send one mail to admin "regarding this still one month only more to delete the folder" . is it possible to do like that date calculation in script.

View 10 Replies View Related

Ubuntu :: Log Overflowing With Read/write Wait Queue Active?

Aug 9, 2010

I am having some trouble with Ubuntu 9.10 For some reason my logs keep overflowing. I have attached a screenshot and a snippet of my kernel log too.

Code:
Aug 9 18:52:04 eowyn kernel: [180754.977296] tty_release_dev: pts4: read/write wait queue active!
Aug 9 18:52:04 eowyn kernel: [180754.977302]

[code]....

View 2 Replies View Related

Programming :: Read Time Of /proc/net/tcp6 File

Dec 8, 2010

I am trying to read the /proc/net/tcp6 file of a huge server (chat server) for monitoring the tcp6 connection states.

My server's tcp6 file has more than 26000 lines. For monitoring the server connections, my monitoring tool has to read the /proc/net/tcp6 file quickly in a regular interval (5 secs) and process. Presently it takes minimum 6-7 seconds for reading the whole file.

My tool can able to read the normal file (26,000 lines) less than 1 second, but it is not possible to read the same size of proc file.

I have 2 questions:

1) Why proc file takes more read time than normal file?

2) Is there any way to read the /proc/net/tcp6 file more quickly?

View 2 Replies View Related

Fedora :: Reinstallation - Display Does Not Shut Off After A Certain Period Of Time

Feb 28, 2010

I just reinstalled, and can't get the setting set right so that my display does not shut off after a certain period of time. It is shutting off after a while of inactivity, and I do not want it to.

View 2 Replies View Related

Fedora :: Auto Hibernate After Suspending For A Period Of Time

Jul 18, 2011

I currently have fedora 15 installed along side windows 7 on my acer aspire d250. So far it runs great, however I was wondering if there is a way to make fedora 15 hibernate after being in suspend for a period of time, just like windows 7 does. This make sense to me as there is no point in wasting battery life if i can hibernate, but I don't want to hibernate all the time, just suspend for a period of time, like 2 hours, in case I need my netbook again i have quick access to it.

View 2 Replies View Related

General :: Cron - Schedule A Service To Run In A Time Period

Mar 2, 2010

i want a service to be start at 8:00 and be ended in 14:00 automatically i already do this manualy by:

/etc/init.d/myservice.sh start
/etc/init.d/myservice.sh stop

i think it should be related to cron jobs.

View 1 Replies View Related

General :: CPU/RAM Usage Log Over A Period Of Time To File On CentOS

Jun 7, 2010

Im looking for an app pr line of code that could let me observe a process, save the info in a number of variable and then put the gathered info on a file.

Ive been trying with variations of top but no luck. I am running several CentOS virtual servers, VM is 2gb ram 2 processor.

Maybe a script that works over a specified amount of time while writing lines with the info on a text file so at the end i can have a sort of table with the data.

The thing is Im going to stress test the server and I would like to have the data to make some statistics.

View 2 Replies View Related

Server :: Unblock The Sites For A Particular Period Of Time Through Proxy?

May 24, 2011

We are using Red Hat linux 4 .We blocked certain sites through squid for certain ip address.we want to unblock these sites in particular interval ,ie during noon time and after 4.00 pm.

Here we have given

In the sites.txt we have given the names the of those sites that should be blocked

The problem is to unblock sites in sites.txt, for particular intervals

View 3 Replies View Related

Programming :: Serial Port Data Read Time Interval?

Oct 30, 2010

I am writing a C program which reads data over serial port. While reading data, if I send my data(which is a 13 byte structure) periodic with a period of 1 second for 10 times I read it without problem and I read the data 10 times as I sent and as I expectBut if I send data continuousuly(without any time interval between each sending) 10 times I can only read 1 of them(I can only read it once).

View 11 Replies View Related

OpenSUSE :: How To Configure For Computer Auto Shutdown After A Period Of Time

May 2, 2011

I install Opensuse 11.4 on KDE environment then I changed to XFCE. I don't know how to configure for computer auto shutdown after a period of time don't use it.

View 6 Replies View Related

Hardware :: External Hard Drive Inaccessible After Period Of Time

Mar 3, 2010

I am running Karmic on my laptop, and I have three 1.5 TB external hard drives which I swap between frequently. My problem is that if I leave the drives in, and do not access them for a period of time, they become inaccessible, i.e. I will click on the icon on the desktop or in Places, and it will tell me there is no device mounted, even though I was using it fine just an hour before.

i have a feeling that it is because the USB drives spin down after a period, and Ubuntu detects them as being 'disconnected'. Would it help if I added individual entries for each in fstab?? Or do I need to adjust some settings elsewhere?

EDIT: If this information helps, the HD's are all Seagate Expansion drives, formatted to ext4.

View 5 Replies View Related

OpenSUSE Hardware :: Nvidia Driver - Power Went Out For Extended Period Of Time

Apr 23, 2011

My power went out for an extended period of time and now my graphics are messed up. I started my computer up and I only can get 640x480, so I was trying to reinstall the drivers but the nvidia drivers on the repositroy do not make sense as far as what goes with what, or descriptions of them. I downloaded the driver off nvidias website instaled it. It went to my desktop same problem.

View 9 Replies View Related

Ubuntu :: Instability In Karmic \ Lock Up Every Time It Had A Period Of Extended Inactivity?

Jan 21, 2010

I skipped over Jaunty on my main desktop because Intrepid had been working perfectly for so long. Finally took the plunge to Karmic, and have had major instability problems. I cannot trace them to any particular program I am using. At first it seemed related to power management, since it would lock up every time it had a period of extended inactivity. I have disabled ACPI in my BIOS (I think), and any power management settings I could find in gnome to try to troubleshoot. That seems to have helped, but it still happens semi-regularly, sometimes when I am in the middle of using it. I have tried checking logs and googled anything that seemed important. ie a message in kern.log reads: Clocksource tsc unstable

View 2 Replies View Related

Servers :: Ubuntu 10.4 Server Stops Accepting Connections After A Period Of Time / Fix It?

Apr 24, 2011

I'm not sure if this belongs in the Server or Networking section of the forums. Anyway, last month I upgraded my server to Ubuntu 10.04 LTS. Since then, I've had a recurring problem wherein after a certain period of time, the server stops accepting network connections. Ubuntu 10 will continue to reject network connections until someone logs into the server locally, after which time network connectivity is restored and the cycle begins anew. Essentially, the server goes into a "half sleep mode". I say half because the computer is still on and the fans are running.

I've done some searching around various forms and initially figured this issue was related to problems with the Network Manager service (https://bugs.launchpad.net/ubuntu/lu...er/+bug/524454), so I removed the service altogether. However, this problem is still occurring.

I've poured over /var/log/messages and /var/log/syslog, but have noticed no irregular behavior. Has anyone else experienced this issues? I'd rather not resort to downgrading back to Gusty Gibbon if I can help it.

I am happy to provide more information if its needed

View 4 Replies View Related

Ubuntu :: CPU Frequency Scaling Monitor Won't Stay At 800mhz After Reboot Or A Certain Period Of Time

Oct 26, 2010

The CPU frequency scaling monitor won't stay at 800mhz after reboot or a certain period of time. My goal is to always have my dual core CPU locked at 800mhz to have it run cooler. I'm running Ubuntu 10.10 on my toshiba u300 laptop.

View 4 Replies View Related

CentOS 5 :: NIC Driver Will Basically Crash/restart Causing No Connectivity For A Period Of Time?

Mar 17, 2010

I'm using centos 5, kernel 2.6.18-164.11.1.el5I have occasional server network problems (the NIC driver will basically crash/restart causing no connectivity for a period of time) due to the marvell sky2 NIC driver being a problem, as discussed here: This essentially means the server is unreliable when under any kind of reasonable load, to put it mildly.Worse still, the driver problem has not been resolved in 2.6.18.x - but it seems to have been resolved in the latest Linux kernels.I really don't want to compile the kernel from source, etc, but it looks like I may have no choice.Is there a repo which has a pre-compiled 2.6.20+ or 2.6.30+ kernel which I can use,

View 8 Replies View Related

Server :: Block Connections To Apache If Client Doesn't Have Valid Request Headers?

Feb 8, 2011

My server gets ddos attacks. I dig into access logs and I saw that attacker ips doesn't have valid requests headers, like their browser application info or requested url info.I want to close those connections immediately, and if it's possible block those ips for a time period.Can I do that with Apache and iptables?I searched on the internet but couldn't find useful results. Probably couldn't search for the right words.

View 2 Replies View Related

Programming :: Use Curl And Spawn Multiple Connection At A Time?

Jan 24, 2010

I am using a perl script which uses curl in the background to download files from rapidshare premium,one file at a time. I wanted to know is it possible to use curl and spawn multiple connection at a time,to download the same file in multiple parts?? I don't seem to find an option in curl which does that.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved