The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
COMP-3 File transmission sharifhere Shell Programming and Scripting 3 02-16-2007 03:38 AM
download files from direct links tool? umen UNIX for Dummies Questions & Answers 2 07-04-2006 10:00 AM
lftp transmission error help Iversog UNIX for Dummies Questions & Answers 0 06-29-2006 11:02 AM
Direct disk access Lopatonosec High Level Programming 3 05-31-2005 12:39 PM
How to direct awk output to expr? jvander Shell Programming and Scripting 4 04-21-2005 09:09 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-24-2002
darkspace darkspace is offline
Registered User
  
 

Join Date: May 2002
Location: Germany
Posts: 5
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 (permalink)  
Old 08-26-2002
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
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 (permalink)  
Old 08-26-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 535
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 (permalink)  
Old 08-26-2002
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
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 (permalink)  
Old 08-26-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 535
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 (permalink)  
Old 08-26-2002
darkspace darkspace is offline
Registered User
  
 

Join Date: May 2002
Location: Germany
Posts: 5
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
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0