LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-24-2006, 06:12 PM   #1
allomeen
Member
 
Registered: Dec 2005
Posts: 83

Rep: Reputation: 15
Read data from a socket


Hello Everyone,

How can I read what ever in the buffer before waiting for the rest of the data.

For example, I'm trying to read from a socket (s2) that I'm connected to, I don't know the size of the data I'm receiving. Lets say s1 is connected to s2, s1 has the statement read(s2, buff, BIG_NUMBER), and s2 will send data but i don't know how much. The read function will be waiting till s2 send BIG_NUMBER data. How can I read the data when s2 sends data but less than the specified size?


Thank you,
Alaa
 
Old 05-08-2006, 03:19 AM   #2
nhydra
Member
 
Registered: May 2006
Distribution: Fedora Core, FreeSpire, PC-BSD, NetBSD
Posts: 96

Rep: Reputation: 15
Quote:
Originally Posted by allomeen
Hello Everyone,

How can I read what ever in the buffer before waiting for the rest of the data.

For example, I'm trying to read from a socket (s2) that I'm connected to, I don't know the size of the data I'm receiving. Lets say s1 is connected to s2, s1 has the statement read(s2, buff, BIG_NUMBER), and s2 will send data but i don't know how much. The read function will be waiting till s2 send BIG_NUMBER data. How can I read the data when s2 sends data but less than the specified size?


Thank you,
Alaa
See the code in the thread "bad data in socket read function"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot read data at server socket, though client socket sends it jacques83 Linux - Networking 0 11-15-2005 01:58 PM
problems receving data in socket programming stephenwalter Programming 5 09-29-2005 11:58 PM
Burn Data DVD... Read Data in Linux and Windows SaintStrive Linux - Newbie 3 09-18-2004 05:04 PM
Receiving all data from socket Ohmu Programming 6 03-08-2004 01:58 PM
read socket adoyee Programming 3 02-26-2004 06:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration