LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-21-2005, 07:25 PM   #1
maldini1010
Member
 
Registered: Sep 2004
Location: Montreal
Posts: 53

Rep: Reputation: 15
Question Socket programming


Hi,

I am creating a socket, writting to the socket ( NO Problem so far ), The write that I do basically tells the server to send me an image. However my read(sock,buffer,size) function call, does not allow me to read more than 1448 bytes. Obviously my image is much greater than that.


Thanks in advance, any help would help, especially that I'm a new at socket programming.
maldini
 
Old 01-21-2005, 07:46 PM   #2
barryman_5000
Member
 
Registered: Jan 2005
Distribution: Gentoo/Vector/Debian
Posts: 95

Rep: Reputation: 15
http://www.erlang.org/ml-archive/erl.../msg00052.html

You can't just open a socket and throw stuff in it or read stuff out of it. The is a limit due to the recieve window and therefore you reach your 1448 number. It'd be best to send and read with a for loop or something sending data back and forth saying "Hey I got that last packet". . . .
 
Old 01-27-2005, 12:17 PM   #3
maldini1010
Member
 
Registered: Sep 2004
Location: Montreal
Posts: 53

Original Poster
Rep: Reputation: 15
Hi,


Thanks for the help, I was able to recursively read the amount of bytes from the socket with a simple

while( i = read(sock,buffer,amounttoread) > 0)
{

}

However, Im having a problem with the consistency in the read, for instance some time he will read 64( since my amounttoread = 64) in one shoot.

And other time he will read much less then 64 and will take , much longer to read all 64 bytes.

I did this test by placing a cout << " heeloo:" inside the while, And on some occasion heeloo gets printed only once , on other it gets printed 60+ times.

If you know of anything which could help me. Probably a good socket web reference or even a good old fashion BOOK..

Also do you know of any other function other than read(),?

THANKS ALOT
MALDINI
 
  


Reply



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
Help me ... about Socket programming.. rajsun Programming 2 04-24-2005 04:50 PM
socket programming???? harbir Linux - Networking 2 07-05-2004 02:52 AM
want help in socket programming valib4u *BSD 2 09-11-2003 11:17 PM
Socket Programming cxel91a Programming 4 03-19-2003 10:05 AM
socket programming herambshembekar Programming 3 04-13-2002 03:13 PM

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

All times are GMT -5. The time now is 04:38 PM.

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