How can I splet packet in socket program which it over 1500 byte?

hi guys,How can I splet packet in socket program which it over 1500 byte?I need Each message is to be transmitted in a singleUDP packet only (MTU size is dependent on Ethernet frame size).How can I use packet.setLength(1500);...?Thanks
[284 byte] By [khalidjabera] at [2007-10-3 4:07:08]
# 1

The MTU is based on the protocol and the OS.

The MTU is a Maximum Size to be sent. If you have less then 1500 bytes, then the packet will be less. You can add padding to increase packet size to match the MTU.

However, to send larger packets (well the MTU is really a frame size), you need to modify the OS or Network Adapter settings. Thus you need access to Windows registry, etc.

There is middleware (JNI) for this.

watertownjordana at 2007-7-14 22:06:41 > top of Java-index,Core,Core APIs...
# 2
The MTU is also determined by the devices in the path to the target, and there is nothing you can do about them.If you're using TCP you don't have to worry about this in the slightest.If you're using UDP you are well advised to use a maximum datagram size of 534 bytes.
ejpa at 2007-7-14 22:06:41 > top of Java-index,Core,Core APIs...