Networking Forums

Networking Forums > Computer Networking > Linux Networking > Sending and reading big data by socket

Reply
Thread Tools Display Modes

Sending and reading big data by socket

 
 
cyril
Guest
Posts: n/a

 
      08-28-2003, 07:16 AM
Hi there,

I wonder how to send and receive big data (by chunk) with an unknown
size in an opened socket in C.

For example, my server can send to my client a big binary file. My
client didn't know the size of the file, so how can I check the end of
the file. Is there a way for my client to know if the connexion was
properly close.

Does anyone have a snippet code for sending and receiving huge amount
of data by sockets ? I can't find some.

Thanks for all, (I keep searching ) )
 
Reply With Quote
 
 
 
 
Phil Frisbie, Jr.
Guest
Posts: n/a

 
      08-28-2003, 03:58 PM
cyril wrote:

> Hi there,
>
> I wonder how to send and receive big data (by chunk) with an unknown
> size in an opened socket in C.
>
> For example, my server can send to my client a big binary file. My
> client didn't know the size of the file, so how can I check the end of
> the file. Is there a way for my client to know if the connexion was
> properly close.


When using a TCP connection and the client is calling recv(), the return value
of recv() will be 0 when the server properly closes the connection.

> Does anyone have a snippet code for sending and receiving huge amount
> of data by sockets ? I can't find some.


They are everywhere... For example, look at the source code for any FTP client
or server.

> Thanks for all, (I keep searching ) )


--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com

 
Reply With Quote
Reply

Thread Tools
Display Modes

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading traffic control dropped data in an application Washington Ratso Linux Networking 1 03-25-2011 10:14 AM
sending socket descriptor to another pid Beagle Linux Networking 2 07-09-2008 09:56 PM
Seeing large amounts of data on udp recv-q, only sending 1 byte of data ssussman@starentnetworks.com Linux Networking 3 05-25-2007 03:44 PM
.NET 2.0: WSEWOULDBLOCK socket error when sending data using synchronous sockets ? Navin Mishra Windows Networking 5 03-22-2007 09:37 PM
100MB network speed vs reading data off a DVD RCE Defiant Home Networking 2 01-28-2006 12:00 AM



1 2 3 4 5 6 7 8 9 10 11