[sctp-dev] We need your help: sctp sends more than 2000pakage/1secend
xieqiang at zbeninfo.com
xieqiang at zbeninfo.com
Wed Mar 25 06:52:30 UTC 2015
Hi,
My project uses sctp(sigtran),but We find a problem.
OS:linux centos 6.4 X64
JDK:jdk-7u51-linux-x64
When client sends more than 2000pakage/1secend,throws some exception:
java.net.SocketException: Connection reset by peer
at sun.nio.ch.SctpChannelImpl.send0(Native Method)
at sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971)
at com.zbeninfo.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:659)
java.net.SocketException: Socket is shutdown for writing
at sun.nio.ch.SctpChannelImpl.send0(Native Method)
at sun.nio.ch.SctpChannelImpl.sendFromNativeBuffer(SctpChannelImpl.java:1039)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:991)
at sun.nio.ch.SctpChannelImpl.send(SctpChannelImpl.java:971)
at com.zbeninfo.protocols.sctp.AssociationImpl.doSendSctp(AssociationImpl.java:659)
The connection is ok:
[root at server-84 bin]# netstat -an|grep 2050
sctp 192.168.1.84:2050 LISTEN
sctp 231688 150296 192.168.1.84:2050 192.168.1.85:2050 ESTABLISHED
Use tcp for test is ok.
After Analysis ,We find:
The client send INIT(outbound stream 32,inbound stream 32) ,
The server receive INIT(outbound stream 32,inbound stream 32),
But,com.sun.nio.sctp.Association.maxOutboundStreams() is 10.
End of comm_up,the server send INIT_ACK (outbound stream 10,inbound stream 32).
Could you please tell us what problem about this?
Attach is pcap file for tcpdump catch.
snippets of code :
class AssociationHandler extends AbstractNotificationHandler<AssociationImpl> {
@Override
public HandlerResult handleNotification(AssociationChangeNotification not, AssociationImpl associtaion) {
switch (not.event()) {
case COMM_UP:
if (not.association() != null) {
this.maxOutboundStreams = not.association().maxOutboundStreams();//get the vlaue is 10
this.maxInboundStreams = not.association().maxInboundStreams();
}
if (logger.isInfoEnabled()) {
logger.info(String.format("New association setup for Association=%s with %d outbound streams, and %d inbound streams.\n",
associtaion.getName(), this.maxOutboundStreams, this.maxInboundStreams));
}
associtaion.createworkerThreadTable(Math.max(this.maxInboundStreams, this.maxOutboundStreams));
try {
associtaion.markAssociationUp();
associtaion.getAssociationListener().onCommunicationUp(associtaion, this.maxInboundStreams, this.maxOutboundStreams);
} catch (Exception e) {
logger.error(String.format("Exception while calling onCommunicationUp on AssociationListener for Association=%s", associtaion.getName()), e);
}
return HandlerResult.CONTINUE;
Toney
from china.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/sctp-dev/attachments/20150325/c11956c2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 22.pcap
Type: application/octet-stream
Size: 1760 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/sctp-dev/attachments/20150325/c11956c2/22.pcap>
More information about the sctp-dev
mailing list