08-30-2006
OK, I suggest that you set up a proper handshake. Currently your scenario is like this:
server -- write size
client -- read size
server -- write data_buffer
client -- read data_buffer
Change that to:
server -- write size
client -- read size
client -- write ACK
server -- read ACK
server -- write data_buffer
client -- read data_buffer
client -- write ACK
and so on....
So it will never be that your server is continuously writing to a socket that the client is not able to read cause it crashed...
10 More Discussions You Might Find Interesting
1. Programming
hi guys, I'have a question 4 u.
Why this code give me the right output (an integer on the stdout):
read(fd,&mpid,sizeof(pid_t));
printf("%d\n",mpid);
Instead this code give me only a blank line:
read(fd,&mpid,sizeof(pid_t));
write(STDOUT_FILENO,&mpid,sizeof(pid_t));
... (2 Replies)
Discussion started by: M3xican
2 Replies
2. UNIX for Dummies Questions & Answers
welll, the title quite explains what i want to do
thanks for your time! (4 Replies)
Discussion started by: kfaday
4 Replies
3. Shell Programming and Scripting
Hi folks,
Need your help.
I am writing a KSH script to read a few commands from a file & execute.
I am using the following code to read the file line by line & excute each command. When I am printing each line I see it is printing properly but while excuting, the particular "ps" command... (5 Replies)
Discussion started by: tipsy
5 Replies
4. UNIX for Dummies Questions & Answers
folks;
I created a new users on my SUSE box and i need to give this user/group a read write access to one specific folder. here's the details:
- I created new user "funny" under group "users".
- I need to give this user "funny" a read/write access to another directory that is owned by "root".... (3 Replies)
Discussion started by: Katkota
3 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I want to know differences between read,write & execute permissons given to directory.
Thanx in advance. (6 Replies)
Discussion started by: vishwasrao
6 Replies
6. Shell Programming and Scripting
Hi,
root@server] df -h
121G 14G 101G 12% /home
147G 126G 14G 91% /backup
We having our site files and images are storing in
/backup/home/user/files/ through symbolic link created in /home directory pointing in /backup directory as following.
root@server] cd /home... (1 Reply)
Discussion started by: mirfan
1 Replies
7. Shell Programming and Scripting
Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP.
I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies
8. IP Networking
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies
9. Programming
I am trying to make a server and client, the client will choose between some options and the server will react accordingly.
After a some reads and writes that work the server needs to read from client an INT i use this:
read(newSd,&k,sizeof(int));But even if all the other times there was no... (1 Reply)
Discussion started by: theSling
1 Replies
10. UNIX for Dummies Questions & Answers
How to use MAN to find information about read() and write() function ?
The command "man read" show some rubbish, for example "man open" show great information about function I need. (2 Replies)
Discussion started by: bbqtoss
2 Replies
VBUF(1) General Commands Manual VBUF(1)
NAME
vbuf - Virtual Ring Buffer shell interface
SYNOPSIS
vbuf [options]
DESCRIPTION
This manual page documents briefly the vbuf command.
vbuf is a program to glue two programs (a producer and a consumer) together, one of which not being able to fulfil the other's constant
data rate requirements.
OPTIONS
-h
Show short help message.
--help
Show long help message.
-p, --progress
Show progress status line.
-q, --quiet
Suppress progress status line. The default is to show the progress display.
-s size, --size=size
Set buffer size in bytes. Suffixes k, m, and g may be used. The actual size used will be rounded up for system mapping require-
ments. The default is 1m, or 1048576 bytes.
-t time, --time=seconds
Set time in seconds between progress display refreshes. Fractions of a second may be used. Default is 1.500000 seconds.
-b, --bits
Set progress rate display units to bits per second.
-B, --bytes
Set progress rate display units to bytes per second. The default is bytes.
-d, --decimal
Set progress rate display base to decimal. The default is decimal.
-x, --hexadecimal
Set progress rate display base to hexadecimal.
--octal
Set progress rate display base to octal.
-i file, --input=file
Specify an input file to be opened and used instead of using stdin.
-o file, --output=file
Specify an output file to be opened and used instead of using stdout.
-M file, --mapfile=file
Specify a file which will be used for backing store for the virtual ring buffer. The allows using filesystem space in case swap
space is full.
-r bytes, --read-min=bytes
Specify the minimum number of bytes to be requested by read. Reading will not happen unless at least this much buffer space is
available. The default is 1.
-R bytes, --read-max=bytes
Specify the maximum number of bytes to be requested by read. Reading will not request more even if more buffer space is available.
The default is the full buffer size.
-w bytes, --write-min=bytes
Specify the minumum number of bytes to be written. Writing will not be done unless at least this much data is available. Once end
of file is reached on input, a smaller amount may be written. The default is 1.
-W bytes, --write-max=bytes
Specify the maximum number of bytes to be written. Writing will not write more each time even if more data is available in the buf-
fer. The default is the full buffer size.
AUTHOR
VRB and vbuf were written by Phil Howard <vrb@ipal.org>.
This manual page was written by Szekelyi Szabolcs <cc@mail.3d.hu>, for the Debian project (but may be used by others).
2006 Sep 5 VBUF(1)