mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 程广 <elf.ch...@browan.com>
Subject Re: Help With NioDatagramAcceptor : [The message is larger than the maximum supported by the underlying transport]
Date Thu, 16 Jul 2009 18:07:52 GMT
在 星期四 16 七月 2009 10:03:30,Mithun Gonsalvez 写道:
> Hi All,
> I have created a NioDatagramAcceptor with the configuration as follows:
>
> IoAcceptor acceptor = new NioDatagramAcceptor();
> DefaultIoFilterChainBuilder filterChain = acceptor.getFilterChain();
>
> Charset charSet = Charset.forName("UTF-8");
> TextLineCodecFactory tLCF = new TextLineCodecFactory(charSet, "\n;\r",
> ";"); filterChain.addLast("codec", new ProtocolCodecFilter(tLCF));
>
> acceptor.setHandler(new MyHandler());
> IoSessionConfig sessionConfig = acceptor.getSessionConfig();
> sessionConfig.setReadBufferSize(2048);
> sessionConfig.setIdleTime(IdleStatus.BOTH_IDLE, 10);
> acceptor.bind(new InetSocketAddress(port));
>
> When i am trying to send a String with about *325010* characters, the
> following exception is obtained........
>
>  at sun.nio.ch.DatagramChannelImpl.send0(Native Method)
>  at
> sun.nio.ch.DatagramChannelImpl.sendFromNativeBuffer(DatagramChannelImpl.jav
>a:301) at sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:281)
> at sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:250) at
> org.apache.mina.transport.socket.nio.NioDatagramAcceptor.send(NioDatagramAc
>ceptor.java:190) at
> org.apache.mina.transport.socket.nio.NioDatagramAcceptor.send(NioDatagramAc
>ceptor.java:47) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.flush(
>AbstractPollingConnectionlessIoAcceptor.java:477) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.flushS
>essions(AbstractPollingConnectionlessIoAcceptor.java:431) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.access
>$700(AbstractPollingConnectionlessIoAcceptor.java:57) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor$Accept
>or.run(AbstractPollingConnectionlessIoAcceptor.java:345) at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java
>:65) at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
>ava:650) at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
>675) at java.lang.Thread.run(Thread.java:595)
>
>    Stack Trace: java.net.SocketException: The message is larger than the
> maximum supported by the underlying transport: no further information
>  at sun.nio.ch.DatagramChannelImpl.send0(Native Method)
>  at
> sun.nio.ch.DatagramChannelImpl.sendFromNativeBuffer(DatagramChannelImpl.jav
>a:301) at sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:281)
> at sun.nio.ch.DatagramChannelImpl.send(DatagramChannelImpl.java:250) at
> org.apache.mina.transport.socket.nio.NioDatagramAcceptor.send(NioDatagramAc
>ceptor.java:190) at
> org.apache.mina.transport.socket.nio.NioDatagramAcceptor.send(NioDatagramAc
>ceptor.java:47) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.flush(
>AbstractPollingConnectionlessIoAcceptor.java:477) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.flushS
>essions(AbstractPollingConnectionlessIoAcceptor.java:431) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor.access
>$700(AbstractPollingConnectionlessIoAcceptor.java:57) at
> org.apache.mina.core.polling.AbstractPollingConnectionlessIoAcceptor$Accept
>or.run(AbstractPollingConnectionlessIoAcceptor.java:345) at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java
>:65) at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
>ava:650) at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
>675) at java.lang.Thread.run(Thread.java:595)
>
>
> Could any one let me know if there any way by which this huge data can be
> sent in multiple packets?
>
>
> Thank You,
> Mithun Gonsalvez

split huge data pack into multi pack is your own logic!!!

Mime
View raw message