Revision: 2648f3b1f524
Author:   Sergey Vetyutnev <[email protected]>
Date:     Mon Jun 17 08:50:27 2013
Log:      Adding storing of acceptAnonymousConnections and
MaxConcurrentConnectionsCount, adding logging of cause of
SendFailedNotification
http://code.google.com/p/sctp/source/detail?r=2648f3b1f524

Modified:
 /.gitignore
/sctp-impl/src/main/java/org/mobicents/protocols/sctp/AssociationHandler.java
 /sctp-impl/src/main/java/org/mobicents/protocols/sctp/ServerImpl.java
 /sctp-impl/src/test/java/org/mobicents/protocols/sctp/ManagementTest.java

=======================================
--- /.gitignore Mon Aug 20 13:02:45 2012
+++ /.gitignore Mon Jun 17 08:50:27 2013
@@ -1,3 +1,5 @@
 target
 /.classpath
 /.project
+/ManagementTest_sctp.xml
+/sctptest.log
=======================================
--- /sctp-impl/src/main/java/org/mobicents/protocols/sctp/AssociationHandler.java Wed Aug 15 09:38:13 2012 +++ /sctp-impl/src/main/java/org/mobicents/protocols/sctp/AssociationHandler.java Mon Jun 17 08:50:27 2013
@@ -157,10 +157,11 @@

        @Override
public HandlerResult handleNotification(SendFailedNotification notification, AssociationImpl associtaion) { - logger.error(String.format("Association=%s SendFailedNotification", associtaion.getName())); +// logger.error(String.format("Association=%s SendFailedNotification", associtaion.getName())); + logger.error(String.format("Association=" + associtaion.getName() + " SendFailedNotification, errorCode=" + notification.errorCode()));
                return HandlerResult.RETURN;
        }
-
+
        @Override
public HandlerResult handleNotification(PeerAddressChangeNotification notification, AssociationImpl associtaion) {
                //associtaion.peerSocketAddress = notification.address();
=======================================
--- /sctp-impl/src/main/java/org/mobicents/protocols/sctp/ServerImpl.java Mon Aug 20 00:11:12 2012 +++ /sctp-impl/src/main/java/org/mobicents/protocols/sctp/ServerImpl.java Mon Jun 17 08:50:27 2013
@@ -38,7 +38,6 @@
 import org.mobicents.protocols.api.Association;
 import org.mobicents.protocols.api.IpChannelType;
 import org.mobicents.protocols.api.Server;
-import org.mobicents.protocols.api.ServerListener;

 import com.sun.nio.sctp.SctpServerChannel;

@@ -59,6 +58,8 @@

        private static final String ASSOCIATIONS = "associations";
        private static final String EXTRA_HOST_ADDRESS = "extraHostAddress";
+ private static final String ACCEPT_ANONYMOUS_CONNECTIONS = "acceptAnonymousConnections"; + private static final String MAX_CONCURRENT_CONNECTIONS_COUNT = "maxConcurrentConnectionsCount";

        private static final String STARTED = "started";

@@ -286,9 +287,10 @@

                StringBuilder sb = new StringBuilder();

- sb.append("Server [name=").append(this.name).append(", started=").append(this.started).append(", hostAddress=") - .append(this.hostAddress).append(", hostPort=").append(hostport).append(", ipChannelType=") - .append(ipChannelType).append(", associations(anonymous does not included)=["); + sb.append("Server [name=").append(this.name).append(", started=").append(this.started).append(", hostAddress=").append(this.hostAddress) + .append(", hostPort=").append(hostport).append(", ipChannelType=").append(ipChannelType).append(", acceptAnonymousConnections=") + .append(this.acceptAnonymousConnections).append(", maxConcurrentConnectionsCount=").append(this.maxConcurrentConnectionsCount)
+                .append(", associations(anonymous does not included)=[");

for (FastList.Node<String> n = this.associations.head(), end = this.associations.tail(); (n = n.getNext()) != end;) {
                        sb.append(n.getValue());
@@ -327,6 +329,9 @@
                        if (server.ipChannelType == null)
                                throw new XMLStreamException("Bad value for 
server.ipChannelType");

+ server.acceptAnonymousConnections = xml.getAttribute(ACCEPT_ANONYMOUS_CONNECTIONS, false); + server.maxConcurrentConnectionsCount = xml.getAttribute(MAX_CONCURRENT_CONNECTIONS_COUNT, 0);
+
int extraHostAddressesSize = xml.getAttribute(EXTRA_HOST_ADDRESS_SIZE, 0);
                        server.extraHostAddresses = new 
String[extraHostAddressesSize];

@@ -344,6 +349,9 @@
                        xml.setAttribute(HOST_ADDRESS, server.hostAddress);
                        xml.setAttribute(HOST_PORT, server.hostport);
                        xml.setAttribute(IPCHANNEL_TYPE, 
server.ipChannelType.getCode());
+ xml.setAttribute(ACCEPT_ANONYMOUS_CONNECTIONS, server.acceptAnonymousConnections); + xml.setAttribute(MAX_CONCURRENT_CONNECTIONS_COUNT, server.maxConcurrentConnectionsCount);
+
                        xml.setAttribute(EXTRA_HOST_ADDRESS_SIZE,
server.extraHostAddresses != null ? server.extraHostAddresses.length : 0);
                        if (server.extraHostAddresses != null) {
=======================================
--- /sctp-impl/src/test/java/org/mobicents/protocols/sctp/ManagementTest.java Thu May 9 04:11:33 2013 +++ /sctp-impl/src/test/java/org/mobicents/protocols/sctp/ManagementTest.java Mon Jun 17 08:50:27 2013
@@ -101,7 +101,7 @@
                management.removeAllResourses();

                String[] arr = new String[]{"127.0.0.2", "127.0.0.3"};
- Server server = management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, false, 0, arr); + Server server = management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, true, 5, arr);

                management.startServer(SERVER_NAME);

--

--- You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to