determine the size of the unix socket packet.

  • Follow


Hi.

I'm writing local message queue library which uses the unix domain
socket(PF_LOCAL, SOCK_DGRAM).

By experimental, on my gentoo linux system (kernel 2.6.15, glibc
2.3.5),
the maximum size of a unix-domain datagram packet is 65536(0x10000)
bytes.

Is there a named macro for this size?
If not, does it fixed value across most systems?
Or, Is there an easy way to determine the maximum size on run-time?

Thanks for advance.

0
Reply cinsky (25) 3/20/2006 10:44:57 PM

<cinsky@gmail.com> wrote in message 
news:1142894697.784818.141710@u72g2000cwu.googlegroups.com...
> Hi.
>
> I'm writing local message queue library which uses the unix domain
> socket(PF_LOCAL, SOCK_DGRAM).
>
> By experimental, on my gentoo linux system (kernel 2.6.15, glibc
> 2.3.5),
> the maximum size of a unix-domain datagram packet is 65536(0x10000)
> bytes.
>
> Is there a named macro for this size?

    No that I know of.

> If not, does it fixed value across most systems?

    It is fixed.

> Or, Is there an easy way to determine the maximum size on run-time?
>
> Thanks for advance.

    It is 65,536, it will always be 65,536. That is the maximum datagram 
size that the UDP protocol can support.

    DS


0
Reply David 3/21/2006 6:17:12 AM


On 2006-03-21, David Schwartz <davids@webmaster.com> wrote:
>
> <cinsky@gmail.com> wrote in message 
> news:1142894697.784818.141710@u72g2000cwu.googlegroups.com...
>> Hi.
>>
>> I'm writing local message queue library which uses the unix domain
>> socket(PF_LOCAL, SOCK_DGRAM).
>>
>> By experimental, on my gentoo linux system (kernel 2.6.15, glibc
>> 2.3.5),
>> the maximum size of a unix-domain datagram packet is 65536(0x10000)
>> bytes.
>>
>> Is there a named macro for this size?
>
>     No that I know of.
>
>> If not, does it fixed value across most systems?
>
>     It is fixed.
>
>> Or, Is there an easy way to determine the maximum size on run-time?
>>
>> Thanks for advance.
>
>     It is 65,536, it will always be 65,536. That is the maximum datagram 
> size that the UDP protocol can support.

UDP is the protocol used for INET datagrams, i didn't think it applied
necessarily to LOCAL ones
0
Reply Jordan 3/21/2006 6:24:18 AM

On 20 Mar 2006 14:44:57 -0800, cinsky@gmail.com wrote:

>Hi.
>
>I'm writing local message queue library which uses the unix domain
>socket(PF_LOCAL, SOCK_DGRAM).
>
>By experimental, on my gentoo linux system (kernel 2.6.15, glibc
>2.3.5),
>the maximum size of a unix-domain datagram packet is 65536(0x10000)
>bytes.
>
>Is there a named macro for this size?
>If not, does it fixed value across most systems?

No, and there is quite some variation in this value across systems.

>Or, Is there an easy way to determine the maximum size on run-time?

For Linux, have a look at the descriptions of SO_SNDBUF and SO_RCVBUF
in the socket(7) manual page.  These values affect the maximum Unix
domain datagram size.

Cheers,

Michael
0
Reply Michael 3/21/2006 7:09:01 PM

Sorry, somehow I thought this was UDP. You are right.

DS

0
Reply davids 3/22/2006 1:56:58 AM

Sorry, somehow I thought this was UDP. You are right.

DS

0
Reply davids 3/22/2006 1:57:02 AM

5 Replies
593 Views

(page loaded in 0.083 seconds)

Similiar Articles:













7/24/2012 5:03:54 AM


Reply: