direct transmission of files via TCP/IP


 
Thread Tools Search this Thread
Top Forums Programming direct transmission of files via TCP/IP
# 1  
Old 08-24-2002
direct transmission of files via TCP/IP

Hi,
is it possible to write files via write() to a socket and read it on the other side via read(), without going through buffers? Iif not via write() and read() are there other possibilities?

thanks
darkspace
# 2  
Old 08-26-2002
I'm not sure that I understand the question. But you can read() and write() to a socket, however a properly constructed read() or write() call must include the address of a buffer for the data.
# 3  
Old 08-26-2002
Quote:
Originally posted by Perderabo
I'm not sure that I understand the question. But you can read() and write() to a socket, however a properly constructed read() or write() call must include the address of a buffer for the data.
Is it possible to use a buffer size of only 1 element? I bet he wants to eliminate any lag related to send/receive with unfilled buffers. I ran into a similiar situation years ago with a bar code reader. I don't remember how I solved the problem (and it was under Win32 anyway).
# 4  
Old 08-26-2002
You can read and write a single byte if you really want to. But sending a byte at a time over a TCP/IP connection is crazy unless you only have a single byte to send. Note that the original question was about sending "files". I think that he wants to send the file straight from disk to the network without the data ever coming into core.
# 5  
Old 08-26-2002
Quote:
Originally posted by Perderabo
You can read and write a single byte if you really want to. But sending a byte at a time over a TCP/IP connection is crazy unless you only have a single byte to send. Note that the original question was about sending "files". I think that he wants to send the file straight from disk to the network without the data ever coming into core.
Yeah. Your probably right. I didn't think of it that way.
# 6  
Old 08-26-2002
Exactly, i do not want to store the file into a buffer (for read or write), but write/read it directly from disk to the socket/ from socket to disk.
I got one solution by mapping the file, then i can use the mapped file as the buffer for the read()/write() function.

thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

For loop in bash - Direct output to two files

Hello all, i have a code in which when doing a for loop, i need to direct the output to two files, one just a single output, the other to always append (historical reasons). So far i managed to do the following, which is working, but am still considering it as "dirty". ... (4 Replies)
Discussion started by: nms
4 Replies

2. UNIX for Advanced & Expert Users

How to detect files transmission at UNIX server ?

Dear Expert Users, I know that Unix utility ( fuser ) is used to detect "transmission" of files from Source system to "current Linux Server". I have scheduled this Unix script to work every 30th minutes of the hour and whenever files transmission starts at that very moment. And, the file... (4 Replies)
Discussion started by: schandrakar1
4 Replies

3. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies

4. Homework & Coursework Questions

C TCP/IP Reliable Transmission project not reliable

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: We must do the following for a massive coding project that is due at 12:20PM on Monday, July 22, 2013. We are to... (1 Reply)
Discussion started by: kowit010
1 Replies

5. Shell Programming and Scripting

Globbling files in the direct subdirectory of the current directory

I want to list files that end with .c in the direct subdirectory of the current directory. I have tried the following command: find ./ -mindepth 2 -maxdepth 2 -name "*.c" Is that right? Or is there any easier way to handle that problem? Another problem is that I want to grep in a file to find... (5 Replies)
Discussion started by: Ray Sun
5 Replies

6. Shell Programming and Scripting

Manipulating sed Direct Input to Direct Output

Hi guys, been scratching round the forums and my mountain of resources. Maybe I havn't read deep enough My question is not how sed edits a stream and outputs it to a file, rather something like this below: I have a .txt with some text in it :rolleyes: abc:123:xyz 123:abc:987... (7 Replies)
Discussion started by: the0nion
7 Replies

7. Shell Programming and Scripting

Connect Direct for copying files from Mainframes to UNIX

Hai Friends, Please help me in providing unix shell script for pulling data from mainframe dataset to unix using connect direct (NDM). Thanks in advance (1 Reply)
Discussion started by: karthikm
1 Replies

8. Shell Programming and Scripting

Been working since 25+ hrs: Bash Script to rename files supposedly direct but difficult to execute

:wall::wall::wall: Hi I have horrible script below, need help in renaming ls -l output into new filename format: Desired output: cp -pv original_path/.* newDirectory/owner_of_file.%dd%mm%y.file_extension.first_8_characters_of_original_filename localuser@localuser:~ vi... (3 Replies)
Discussion started by: wolf@=NK
3 Replies

9. Shell Programming and Scripting

Direct the invalid lines to a separate files

Hi, I have a pipe delimited file with 1 million records. I need to validate each line by counting the number of delimiters, if any line fails to have the specified number of delimiters, taat line has to be sent to a reject file. Kindly suggest. if code provided, it is highly appreciated, and... (22 Replies)
Discussion started by: anandapani
22 Replies

10. UNIX for Dummies Questions & Answers

download files from direct links tool?

Hello all I wander of there is small utility that gives me the possibility to download direct links to specific folder say if i have http://www.blah.com/foo.java and I like to download the foo.java without opening the browser and such... (2 Replies)
Discussion started by: umen
2 Replies
Login or Register to Ask a Question

Featured Tech Videos