LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2003, 03:49 AM   #1
slowman
LQ Newbie
 
Registered: Feb 2003
Posts: 2

Rep: Reputation: 0
Socket buffer size problem


I am programming a client-server model and have the need to send large amount of data. The client connects to the server, then selects a file to be transfered (like an ftp program) and the server sends it.

The problem is that I cant seem to send packets larger then 7 kbytes.... The client crashes just after recieved 2 packets. I am using this code to create a socket:

sock = socket(PF_INET, SOCK_STREAM, 0);

I have also tried to increase the socket buffer with the following:

setsockopt(sock, SOL_SOCKET, SO_RCVBUF, &sock_buf, &sock_size);

sock_size is an integer currently set to 64000.

This is done with both the recieve and the send buffer on both the client and the server.

If anyone have any tips or suggestions please help me, anything at all is highly appreciated!!!!
 
Old 06-08-2003, 12:30 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Moved: Seems to be more suitable in the Programming forum.
 
Old 06-08-2003, 02:06 PM   #3
PTBmilo
Member
 
Registered: Jan 2003
Posts: 167

Rep: Reputation: 30
where does it fail? did you check errno?

EDIT:
<I am running into a similar problem>
Are you sending some kind of small protocol-level messages? Maybe your getting hung up on a blocking read because your SENDQ/RECVQ are too big?

Maybe try using out-of-band packets for the messages?

I'm wondering which is better to do <for my app>:
1) pray that the packets get sent
2) toggle SEND/RECV-Q's every time control message sent (and possibley TCP_NODELAY?)
3) send out-of-band

maybe I'm way off track here.
comments?

Sorry for the ramble, but I think you might have the same issue.

Last edited by PTBmilo; 06-08-2003 at 04:10 PM.
 
  


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
Linux Pipe Buffer size traku Linux - Newbie 1 10-23-2009 07:48 AM
socket buffer TCP lucs Slackware 0 05-05-2005 07:26 AM
Data buffer size MarcReing Programming 7 10-21-2004 12:51 PM
Squid: "Socket error... (55) no buffer space available J_Szucs Linux - Networking 1 08-30-2004 08:10 AM
CD write buffer size rch Linux - General 1 09-26-2003 05:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:59 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