Solved

Max. datasize in (unix) sockets

Posted on 2000-03-11
1
243 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

860 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