Solved

Max. datasize in (unix) sockets

Posted on 2000-03-11
1
250 Views
Last Modified: 2010-04-02
Hi,

Does anyone know if there's a maximum datasize that can be passed to one call to a sockets send() function?
There's seems to be some limit around 30-40Kb on Linux and less on FreeBSD...
Is there any docs mentioning this?

Thanks

Jan
0
Comment
Question by:janmagpet
1 Comment
 
LVL 3

Accepted Solution

by:
ufolk123 earned 50 total points
ID: 2609086
Hi janmqpet,

This value is protocol dependent.As for example in datagram sockets, if you pass the X bytes UDP datagram to send,It will have to fragment it to different IP packets for delivery.As
On the target machine defragmentation will be requitr to generate the orginal datagram of X size, The limit on size is generally bounded by the protocol to reduce the overhead of largely fragmented UDP data.
Generally the limit is only for UDP based communication.There is no standard limit of SOCK_STREAM sockets.In stream sockets (TCP) the size is limited by the Buffer size of Sending party.You can configure this using setsockopt( SND_BUFFSIZE option).

as MS help says :->
If the data is too long to pass atomically through the underlying protocol, the error WSAEMSGSIZE is returned, and no data is transmitted.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question