473,811 Members | 3,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UDP max datagram size

Hi. I've been looking everywhere for this and can't find it, apologies
if I'm being obtuse: How do I set the max datagram packet size? I'm
using the socket module. It seem like it's hardcoded at 255, but I
need it to be larger.

Iain

Apr 12 '06 #1
6 6278
Am Mittwoch 12 April 2006 10:26 schrieb Iain King:
Hi. I've been looking everywhere for this and can't find it, apologies
if I'm being obtuse: How do I set the max datagram packet size? I'm
using the socket module. It seem like it's hardcoded at 255, but I
need it to be larger.


The minimal size any IP-stack has to be able to handle is 512 bytes. Normally,
modern IP stacks will handle packets up to 4096 bytes and possibly larger
packets (with correct fragmentation and rejoining). But this depends on the
IP stack that's used to send and to receive the packet.

Anyway, a maximum size of 255 bytes is certainly not true for UDP packets.

--- Heiko.
Apr 12 '06 #2

Heiko Wundram wrote:
Am Mittwoch 12 April 2006 10:26 schrieb Iain King:
Hi. I've been looking everywhere for this and can't find it, apologies
if I'm being obtuse: How do I set the max datagram packet size? I'm
using the socket module. It seem like it's hardcoded at 255, but I
need it to be larger.


The minimal size any IP-stack has to be able to handle is 512 bytes. Normally,
modern IP stacks will handle packets up to 4096 bytes and possibly larger
packets (with correct fragmentation and rejoining). But this depends on the
IP stack that's used to send and to receive the packet.

Anyway, a maximum size of 255 bytes is certainly not true for UDP packets.

--- Heiko.


Yep, I was just being dumb. Thanks anyway.

Iain

Apr 12 '06 #3
I seem to recall from UDP datagram tests between linux and XP I ran a
few years ago that XP maximum datagram sizes are indeed smaller than
linux.

Apr 12 '06 #4
First of all: why do you want to translate pythont to C++?

Anyway, this has a C back-end:
http://www.pypy.org

Szabi

On 4/12/06, Michael Yanowitz <m.********@kea rfott.com> wrote:
Hello:

One topic that has always interested me are the Language translators.
Are there any that convert between Python and C++ or Python and Java?
I remember seeing one that converts from Python to or from Perl but couldn't
find it on a quick google search. I did find a Python2C
http://sourceforge.net/projects/p2c/ and I found:
http://www.strout.net/python/ai/python2c.py which are obviously incomplete.
I know there have been many discussions recently regarding C and C++.
I am (or is it - was?) a C/C++ programmer for over 15 years. Just started
with Python as we need to write come quick code in script form which can
be generated and run through an interpreter.
If not could there be a converter from Python to/from Language X and
from Language X to/from C or C++?
In another thread mentioning a decompiler. Perhaps Python to Assembly
and Assembly 2 C?

Thanks in advance:

--
http://mail.python.org/mailman/listinfo/python-list

Apr 12 '06 #5
On 2006-04-12, Iain King <ia******@gmail .com> wrote:
Hi. I've been looking everywhere for this and can't find it, apologies
if I'm being obtuse: How do I set the max datagram packet size?
What do you mean "datgram packet size"?
I'm using the socket module. It seem like it's hardcoded at
255, but I need it to be larger.


My tests show that Linux handles UDP datagrams of up to about
59000 on the "lo" interface and 12500 on Ethernet interfaces.

--
Grant Edwards grante Yow! Vote for ME
at -- I'm well-tapered,
visi.com half-cocked, ill-conceived
and TAX-DEFERRED!
Apr 12 '06 #6
You should check Shed Skin (Python-to-C++ Compiler):

http://shed-skin.blogspot.com/

Apr 13 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4108
by: Dave | last post by:
Hi, This is doubtless a really dumb question but is there an elegant way of reading numbers formatted as hex from a datgram? I get a datgram which contains values like this: ---DATAGRAM--- 2aef2d43etc... ---/DATAGRAM--
0
1251
by: Jonathan Ellis | last post by:
I seem to be running into a limit of 64 queued datagrams. This isn't a data buffer size; varying the size of the datagram makes no difference in the observed queue size. If more datagrams are sent before some are read, they are silently dropped. (By "silently," I mean, "tcpdump doesn't record these as dropped packets.") This is a problem because while my consumer can handle the overall load easily, the requests often come in large...
4
33781
by: Gregory Hassett | last post by:
Hello, Does anyone know how to get the maximum size of a datagram for a UDP Socket created via .NET's System.Net.Sockets.Socket class? Thanks!
4
2791
by: alberto.castellin | last post by:
Hi to all, I've this problem: I create a datagram socket. I create datagram socket with function 'Create'. The line of my code when I create is: m_pSocket->Create(port,SOCK_DGRAM,FD_READ | FD_WRITE | FD_OOB | FD_ACCEPT | FD_CONNECT | FD_CLOSE,strAddress); Now when I send, I' ve error in runtime at this line:
2
1417
by: DaTurk | last post by:
I know in TCP if you send a message down the wire, the OS may lump subsequent messages into a buffer before sending it across the wire, for efficiency. But, will the OS do the same thing with UDP? I'm just concerned that I may be getting multiple messages in a single datagram. I'm using a connectionless multicast paradigm where there are multiple receivers listening asynchronously, and a single sender sending synchronously.
1
3590
by: greenxiar | last post by:
My code is below and the platform is Win2K3 R2: using System; using System.Net; using System.Net.Sockets; using System.Threading; namespace TechUDPBroadcast { class Program { static void Main(string args) {
6
2348
by: 7stud | last post by:
I'm trying to understand datagrams. My client program sends a message to the server, and then the server infinitely loops over the recv() to make sure all the data was received. I'm trying to use an * to signal the end of the message, so that the server can break out of the infinite while loop used to check the recv(). However, my server repeatedly outputs the client message over and over again. Can anyone tell me why? When I start...
1
2952
by: sfncook | last post by:
Hi, As far as I can tell you can't call the accept function on a datagram socket. So why did this guy publish this sample code? http://www.codersource.net/winsock_tutorial_server_select_model.html I modified it a little to fit it into my object and get a 10045 error at the accept() function when I try to connect with a client. Thanks for any help folks.
8
3417
by: babakandme | last post by:
How can I read IP Datagram? Should I write some Driver for that? Is there any special book about it? Thank you.
0
9731
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.