Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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". . . .
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(),?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.