java - Message too long for UDP socket after setting sendBufferSize() -


I am trying to send a UDP datagram (which has a protocol buffer message) and receive very long exception messages:

  java.io.IOException: The message at Java.net is too long. Planetatramasacental impulse asand (native method) on Javanet. Datagram.code (Datagram.java.625)  

I sent a buffer shape, and checkback value from getBufferSize (), and it is larger than the message:

  byte [] b = msg.to batare (); System.out.println ("" + b.length + "bytes in serialized message (max length:" + network.getSendBufferSize (+) ");); Datagram Packet P = New Datagram Packet (B, B Long, Host, Port); Network.send (p);  

Output:

  VM Version: 16.3-B01-279 Version: 1.6.0_20-B 02-279-9 M3165 Dealer: Apple Inc. . Problem sending packets in serialized 69424 bytes (max length: 531075): java.io.IOException: very long message  

I can understand that this is a large size buffer I was refusing to set up, but it seems I do not respect whatever I ask for it to set, and after that.

It is on OSX; I have tried both with 1.6 and 1.5

UDP datagram can not be larger than 64K


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -