io.netty.channel.sctp.nio.NioSctpChannel#org.mobicents.protocols.api.IpChannelType源码实例Demo

下面列出了io.netty.channel.sctp.nio.NioSctpChannel#org.mobicents.protocols.api.IpChannelType 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: SigFW   文件: DiameterFirewallPerformanceTests.java
public static void main(String[] args) {
    DiameterFirewallPerformanceTests ec = new DiameterFirewallPerformanceTests();
    try {
        ec.initSCTP(IpChannelType.SCTP);

        ec.start();

        while (!ec.finished()) {
            try {
                Thread.currentThread().sleep(5000);
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

    } catch (Exception ex) {
        java.util.logging.Logger.getLogger(DiameterFirewallPerformanceTests.class.getName()).log(Level.SEVERE, null, ex);
    }
}
 
源代码2 项目: sctp   文件: AddressInUseTest.java
public void setUp(IpChannelType ipChannelType) throws Exception {
		this.clientAssocUp = false;
		this.serverAssocUp = false;

		this.clientAssocDown = false;
		this.serverAssocDown = false;

//		this.clientMessage = null;
//		this.serverMessage = null;

		this.management = new ManagementImpl("server-management");
		this.management.setSingleThread(true);
		this.management.start();
        this.management.setConnectDelay(5000);// Try connecting every 5 secs
		this.management.removeAllResourses();

		this.server = this.management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, false, 0, null);
		this.serverAssociation = this.management.addServerAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);
		this.clientAssociation = this.management.addAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME, ipChannelType,
				null);
	}
 
源代码3 项目: sctp   文件: SctpTransferTest.java
public void setUp(IpChannelType ipChannelType) throws Exception {
	this.clientMaxInboundStreams = 0;
	this.serverMaxOutboundStreams = 0;
	
	this.clientAssocUp = false;
	this.serverAssocUp = false;

	this.clientAssocDown = false;
	this.serverAssocDown = false;

	this.clientMessage = null;
	this.serverMessage = null;

	this.management = new ManagementImpl("server-management");
	this.management.setSingleThread(true);
	this.management.start();
       this.management.setConnectDelay(10000);// Try connecting every 10 secs
	this.management.removeAllResourses();

	this.server = this.management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, false, 0, null);
	this.serverAssociation = this.management.addServerAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);
	this.clientAssociation = this.management.addAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME, ipChannelType,
			null);
}
 
源代码4 项目: SigFW   文件: SS7ClientLiveInput.java
private void initSCTP(IpChannelType ipChannelType) throws Exception {
    logger.debug("Initializing SCTP Stack ....");
    this.sctpManagement = new ManagementImpl("SctpClientSCTP");
    
    this.sctpManagement.setPersistDir(persistDir);
    
    this.sctpManagement.setSingleThread(false);
    this.sctpManagement.start();
    this.sctpManagement.setConnectDelay(10000);
    this.sctpManagement.setMaxIOErrors(30);
    this.sctpManagement.removeAllResourses();
    this.sctpManagement.addManagementEventListener(this);

    // 1. Create SCTP Association
    sctpManagement.addAssociation(CLIENT_IP, CLIENT_PORT, SERVER_IP, /*SERVER_PORT*/3433, CLIENT_ASSOCIATION_NAME,
            ipChannelType, null);
    logger.debug("Initialized SCTP Stack ....");
    
}
 
protected void initializeStack(IpChannelType ipChannelType) throws Exception {

        this.initSCTP(ipChannelType);

        // Initialize M3UA first
        this.initM3UA();

        // Initialize SCCP
        this.initSCCP();

        // Initialize TCAP
        this.initTCAP();

        // Initialize MAP
        this.initMAP();

        // FInally start ASP
        // Set 5: Finally start ASP
        this.serverM3UAMgmt.startAsp("SASP1");
    }
 
private void initSCTP(IpChannelType ipChannelType) throws Exception {
    logger.debug("Initializing SCTP Stack ....");
    this.sctpManagement = new ManagementImpl("Server");
    this.sctpManagement.setSingleThread(true);
    this.sctpManagement.start();
    this.sctpManagement.setConnectDelay(10000);
    this.sctpManagement.removeAllResourses();

    //1. Create SCTP Server
    sctpManagement.addServer(SERVER_NAME, SERVER_IP,SERVER_PORT, ipChannelType,null);
    // 2. Create SCTP Association
    sctpManagement.addServerAssociation(CLIENT_IP, CLIENT_PORT, SERVER_NAME,SERVER_ASSOCIATION_NAME,ipChannelType);
    //3. Start Sever
    sctpManagement.startServer(SERVER_NAME);

    logger.debug("Initialized SCTP Stack ....");
}
 
源代码7 项目: sctp   文件: NettyAddressInUseTest.java
public void setUp(IpChannelType ipChannelType) throws Exception {
        this.clientAssocUp = false;
        this.serverAssocUp = false;

        this.clientAssocDown = false;
        this.serverAssocDown = false;

        this.management = new NettySctpManagementImpl("server-management");
//        this.management.setSingleThread(true);
        this.management.start();
        this.management.setConnectDelay(5000);// Try connecting every 5 secs
        this.management.removeAllResourses();

        this.server = (NettyServerImpl) this.management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, false,
                0, null);
        this.serverAssociation = (NettyAssociationImpl) this.management.addServerAssociation(CLIENT_HOST, CLIENT_PORT,
                SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);
        this.clientAssociation = (NettyAssociationImpl) this.management.addAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_HOST,
                SERVER_PORT, CLIENT_ASSOCIATION_NAME, ipChannelType, null);
    }
 
源代码8 项目: SigPloit   文件: SendRoutingInfoResp.java
protected void initializeStack(IpChannelType ipChannelType) throws Exception {

        this.initSCTP(ipChannelType);

        // Initialize M3UA first
        this.initM3UA();

        // Initialize SCCP
        this.initSCCP();

        // Initialize TCAP
        this.initTCAP();

        // Initialize MAP
        this.initMAP();

        // FInally start ASP
        // Set 5: Finally start ASP
        this.serverM3UAMgmt.startAsp("SASP1");
    }
 
源代码9 项目: sctp   文件: NettySctpMultiHomeTransferTest.java
public void setUp(IpChannelType ipChannelType) throws Exception {
        this.clientAssocUp = false;
        this.serverAssocUp = false;

        this.clientAssocDown = false;
        this.serverAssocDown = false;

        this.clientMessage = new FastList<String>();
        this.serverMessage = new FastList<String>();

        this.management = new NettySctpManagementImpl("server-management");
//        this.management.setSingleThread(true);
        this.management.start();
        this.management.setConnectDelay(10000);// Try connecting every 10 secs
        this.management.removeAllResourses();

        this.server = (NettyServerImpl) this.management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, false,
                0, new String[] { SERVER_HOST1 });
        this.serverAssociation = (NettyAssociationImpl) this.management.addServerAssociation(CLIENT_HOST, CLIENT_PORT,
                SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);
        this.clientAssociation = (NettyAssociationImpl) this.management.addAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_HOST,
                SERVER_PORT, CLIENT_ASSOCIATION_NAME, ipChannelType, new String[] { CLIENT_HOST1 });
    }
 
源代码10 项目: SigPloit   文件: SriSMResp.java
private void initSCTP(IpChannelType ipChannelType) throws Exception {
    logger.debug("Initializing SCTP Stack ....");
    this.sctpManagement = new ManagementImpl("Server");
    this.sctpManagement.setSingleThread(true);
    this.sctpManagement.start();
    this.sctpManagement.setConnectDelay(10000);
    this.sctpManagement.removeAllResourses();

    //1. Create SCTP Server
    sctpManagement.addServer(SERVER_NAME, SERVER_IP,SERVER_PORT, ipChannelType,null);
    // 2. Create SCTP Association
    sctpManagement.addServerAssociation(CLIENT_IP, CLIENT_PORT, SERVER_NAME,SERVER_ASSOCIATION_NAME,ipChannelType);
    //3. Start Sever
    sctpManagement.startServer(SERVER_NAME);

    logger.debug("Initialized SCTP Stack ....");
}
 
源代码11 项目: SigPloit   文件: SendRoutingInfoForGPRS.java
protected void initializeStack(IpChannelType ipChannelType) throws Exception {

        this.initSCTP(ipChannelType);

        // Initialize M3UA first
        this.initM3UA();

        // Initialize SCCP
        this.initSCCP();

        // Initialize TCAP
        this.initTCAP();

        // Initialize MAP
        this.initMAP();

        // FInally start ASP
        // Set 5: Finally start ASP
        this.serverM3UAMgmt.startAsp("SASP1");
    }
 
源代码12 项目: SigPloit   文件: SendIMSIResp.java
public static void main(String args[]) {
    System.out.println("*********************************************");
    System.out.println("***      IMSI Information - HLR           ***");
    System.out.println("*********************************************");
    IpChannelType ipChannelType = IpChannelType.SCTP;

    final SendIMSIResp victim = new SendIMSIResp();

    logger.setLevel(org.apache.log4j.Level.DEBUG);

    try {
        victim.initializeStack(ipChannelType);

        // Lets pause for 20 seconds so stacks are initialized properly
        Thread.sleep(20000);


    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
源代码13 项目: SigPloit   文件: UpdateLocationResp.java
private void initSCTP(IpChannelType ipChannelType) throws Exception {
    logger.debug("Initializing SCTP Stack ....");
    this.sctpManagement = new ManagementImpl("Server");
    this.sctpManagement.setSingleThread(true);
    this.sctpManagement.start();
    this.sctpManagement.setConnectDelay(10000);
    this.sctpManagement.removeAllResourses();

    //1. Create SCTP Server
    sctpManagement.addServer(SERVER_NAME, SERVER_IP,SERVER_PORT, ipChannelType,null);
    // 2. Create SCTP Association
    sctpManagement.addServerAssociation(CLIENT_IP, CLIENT_PORT, SERVER_NAME,SERVER_ASSOCIATION_NAME,ipChannelType);
    //3. Start Sever
    sctpManagement.startServer(SERVER_NAME);

    logger.debug("Initialized SCTP Stack ....");
}
 
源代码14 项目: gmlc   文件: Server.java
private void initSCTP(IpChannelType ipChannelType) throws Exception {
  this.sctpManagement = new NettySctpManagementImpl("Server");
  // this.sctpManagement.setSingleThread(false);
  this.sctpManagement.start();
  this.sctpManagement.setConnectDelay(10000);
  this.sctpManagement.removeAllResourses();

  // 1. Create SCTP Server
  sctpManagement.addServer(SERVER_NAME, SERVER_IP, SERVER_PORT, ipChannelType, null);

  // 2. Create SCTP Server Association
  sctpManagement.addServerAssociation(CLIENT_IP, CLIENT_PORT, SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);

  // 3. Start Server
  sctpManagement.startServer(SERVER_NAME);
}
 
源代码15 项目: sctp   文件: NettyModifyAssociationTest.java
public void setUp(IpChannelType ipChannelType, int serverPort, int clientPort) throws Exception {
	this.clientAssocUp = false;
	this.serverAssocUp = false;

	this.clientAssocDown = false;
	this.serverAssocDown = false;

	this.clientMessage = null;
	this.serverMessage = null;

	this.management = new NettySctpManagementImpl("ClientAssociationTest");
	this.management.setSingleThread(true);
	this.management.start();
       this.management.setConnectDelay(1000);
	this.management.removeAllResourses();

	this.server = (NettyServerImpl) this.management.addServer(SERVER_NAME, SERVER_HOST, serverPort, ipChannelType, false, 0, null);
	this.serverAssociation = (NettyAssociationImpl) this.management.addServerAssociation(CLIENT_HOST, clientPort, SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);
	this.clientAssociation = (NettyAssociationImpl) this.management.addAssociation(CLIENT_HOST, clientPort, SERVER_HOST, serverPort, CLIENT_ASSOCIATION_NAME, ipChannelType, null);
}
 
源代码16 项目: sctp   文件: ModifyAssociationTest.java
public void setUp(IpChannelType ipChannelType, int serverPort, int clientPort) throws Exception {
	this.clientAssocUp = false;
	this.serverAssocUp = false;

	this.clientAssocDown = false;
	this.serverAssocDown = false;

	this.clientMessage = null;
	this.serverMessage = null;

	this.management = new ManagementImpl("ClientAssociationTest");
	this.management.setSingleThread(true);
	this.management.start();
       this.management.setConnectDelay(1000);
	this.management.removeAllResourses();

	this.server = this.management.addServer(SERVER_NAME, SERVER_HOST, serverPort, ipChannelType, false, 0, null);
	this.serverAssociation = this.management.addServerAssociation(CLIENT_HOST, clientPort, SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);
	this.clientAssociation = this.management.addAssociation(CLIENT_HOST, clientPort, SERVER_HOST, serverPort, CLIENT_ASSOCIATION_NAME, ipChannelType, null);
}
 
源代码17 项目: sctp   文件: ServerImpl.java
@SuppressWarnings("unchecked")
@Override
public void read(javolution.xml.XMLFormat.InputElement xml, ServerImpl server) throws XMLStreamException {
	server.name = xml.getAttribute(NAME, "");
	server.started = xml.getAttribute(STARTED, false);
	server.hostAddress = xml.getAttribute(HOST_ADDRESS, "");
	server.hostport = xml.getAttribute(HOST_PORT, 0);
	server.ipChannelType = IpChannelType.getInstance(xml.getAttribute(IPCHANNEL_TYPE,
			IpChannelType.SCTP.getCode()));
	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];
	
	for(int i=0;i<extraHostAddressesSize;i++){
		server.extraHostAddresses[i] = xml.get(EXTRA_HOST_ADDRESS, String.class);
	}
	
	server.associations = xml.get(ASSOCIATIONS, FastList.class);
}
 
源代码18 项目: sctp   文件: NettySctpClientHandler.java
@Override
public void channelActive(ChannelHandlerContext ctx) {
    if (logger.isDebugEnabled()) {
        logger.debug(String.format("channelActive event: association=%s", this.association));
    }

    this.ctx = ctx;
    this.channel = ctx.channel();
    this.association.setChannelHandler(this);

    String host = null;
    int port = 0;
    InetSocketAddress sockAdd = ((InetSocketAddress) channel.remoteAddress());
    if (sockAdd != null) {
        host = sockAdd.getAddress().getHostAddress();
        port = sockAdd.getPort();
    }

    if (logger.isInfoEnabled()) {
        logger.info(String.format("Association=%s connected to host=%s port=%d", association.getName(), host, port));
    }

    if (association.getIpChannelType() == IpChannelType.TCP) {
        this.association.markAssociationUp(1, 1);
    }
}
 
源代码19 项目: sctp   文件: ManagementTest.java
private void testStopAssociationByProtocol(IpChannelType ipChannelType) throws Exception {

		ManagementImpl management = new ManagementImpl("ManagementTest");
		management.setSingleThread(true);
		management.start();
        management.setConnectDelay(10000);// Try connecting every 10 secs
		management.removeAllResourses();

		management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, false, 0, null);
		Association serverAssociation = management.addServerAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_NAME, SERVER_ASSOCIATION_NAME, ipChannelType);
		Association clientAssociation = management.addAssociation(CLIENT_HOST, CLIENT_PORT, SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME, ipChannelType, null);

		management.startServer(SERVER_NAME);


		serverAssociation.setAssociationListener(new ServerAssociationListener());
		management.startAssociation(SERVER_ASSOCIATION_NAME);
		clientAssociation.setAssociationListener(new ClientAssociationListener());
		management.startAssociation(CLIENT_ASSOCIATION_NAME);

		for (int i1 = 0; i1 < 40; i1++) {
			if (serverAssociation.isConnected())
				break;
			Thread.sleep(1000 * 5);
		}
		Thread.sleep(1000 * 1);

		assertTrue(serverAssociation.isConnected());
		assertTrue(clientAssociation.isConnected());

		management.stop();

		assertFalse(serverAssociation.isConnected());
		assertFalse(clientAssociation.isConnected());

	}
 
源代码20 项目: sctp   文件: NettyAnonymousConnectionTest.java
public void setUp(IpChannelType ipChannelType) throws Exception {

        this.management = new NettySctpManagementImpl("server-management");
//        this.management.setSingleThread(true);
        this.management.start();
        this.management.setConnectDelay(CONNECT_DELAY);// Try connecting every x secs
        this.management.removeAllResourses();

        this.management2 = new NettySctpManagementImpl("server-management2");
//        this.management2.setSingleThread(true);
        this.management2.start();
        this.management2.setConnectDelay(CONNECT_DELAY);// Try connecting every x secs
        this.management2.removeAllResourses();

        this.management3 = new NettySctpManagementImpl("server-management3");
//        this.management3.setSingleThread(true);
        this.management3.start();
        this.management3.setConnectDelay(CONNECT_DELAY);// Try connecting every x secs
        this.management3.removeAllResourses();

        this.server = (NettyServerImpl) this.management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, true,
                2, null);
        this.clientAssociation1 = (NettyAssociationImpl) this.management.addAssociation(CLIENT_HOST, CLIENT_PORT1, SERVER_HOST,
                SERVER_PORT, CLIENT_ASSOCIATION_NAME1, ipChannelType, null);
        this.clientAssociation2 = (NettyAssociationImpl) this.management2.addAssociation(CLIENT_HOST, CLIENT_PORT2,
                SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME2, ipChannelType, null);
        this.clientAssociation3 = (NettyAssociationImpl) this.management3.addAssociation(CLIENT_HOST, CLIENT_PORT3,
                SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME3, ipChannelType, null);
    }
 
源代码21 项目: sctp   文件: NettyAnonymousConnectionTest.java
/**
 * Simple test that creates Client and Server Association, exchanges data
 * and brings down association. Finally removes the Associations and Server
 */
@Test(groups = { "functional", "sctp" })
public void testAnonymousSctp() throws Exception {

    if (SctpTransferTest.checkSctpEnabled())
        this.testAnonymousByProtocol(IpChannelType.SCTP);
}
 
源代码22 项目: sctp   文件: SctpTransferTest.java
/**
 * Simple test that creates Client and Server Association, exchanges data
 * and brings down association. Finally removes the Associations and Server
 */
@Test(groups = { "functional", "tcp" })
public void testDataTransferTcp() throws Exception {

	// BasicConfigurator.configure();
	// Logger logger = Logger.getLogger(ServerImpl.class.getName());
	// logger.setLevel(Level.ALL);

	this.testDataTransferByProtocol(IpChannelType.TCP);
}
 
源代码23 项目: sctp   文件: AnonymousConnectionTest.java
/**
 * Simple test that creates Client and Server Association, exchanges data
 * and brings down association. Finally removes the Associations and Server
 */
@Test(groups = { "functional", "tcp" })
public void testAnonymousTcp() throws Exception {

	// BasicConfigurator.configure();
	// Logger logger = Logger.getLogger(ServerImpl.class.getName());
	// logger.setLevel(Level.ALL);

	this.testAnonymousByProtocol(IpChannelType.TCP);
}
 
源代码24 项目: sctp   文件: NettyAssociationImpl.java
/**
 * Creating a CLIENT Association
 * 
 * @param hostAddress
 * @param hostPort
 * @param peerAddress
 * @param peerPort
 * @param assocName
 * @param ipChannelType
 * @param extraHostAddresses
 * @throws IOException
 */
public NettyAssociationImpl(String hostAddress, int hostPort, String peerAddress, int peerPort, String assocName,
        IpChannelType ipChannelType, String[] extraHostAddresses) throws IOException {
    this();
    this.hostAddress = hostAddress;
    this.hostPort = hostPort;
    this.peerAddress = peerAddress;
    this.peerPort = peerPort;
    this.name = assocName;
    this.ipChannelType = ipChannelType;
    this.extraHostAddresses = extraHostAddresses;

    this.type = AssociationType.CLIENT;
}
 
源代码25 项目: gmlc   文件: Client.java
private void initSCTP(IpChannelType ipChannelType) throws Exception {
  this.sctpManagement = new NettySctpManagementImpl("Client");
  // this.sctpManagement.setSingleThread(false);
  this.sctpManagement.start();
  this.sctpManagement.setConnectDelay(10000);
  this.sctpManagement.removeAllResourses();

  // 1. Create SCTP Association
  sctpManagement.addAssociation(CLIENT_IP, CLIENT_PORT, SERVER_IP, SERVER_PORT, CLIENT_ASSOCIATION_NAME, ipChannelType,
      null);
}
 
源代码26 项目: sctp   文件: ManagementTest.java
/**
 * Test the creation of Server. Stop management and start, and Server should
 * be started automatically
 * 
 * @throws Exception
 */
@Test(groups = { "functional", "sctp" })
public void testServerSctp() throws Exception {
	
	if (SctpTransferTest.checkSctpEnabled())
		this.testServerByProtocol(IpChannelType.SCTP);
}
 
源代码27 项目: sctp   文件: AnonymousConnectionTest.java
public void setUp(IpChannelType ipChannelType) throws Exception {

		this.management = new ManagementImpl("server-management");
		this.management.setSingleThread(true);
		this.management.start();
        this.management.setConnectDelay(CONNECT_DELAY);// Try connecting every x secs
		this.management.removeAllResourses();

		this.management2 = new ManagementImpl("server-management2");
		this.management2.setSingleThread(true);
		this.management2.start();
        this.management2.setConnectDelay(CONNECT_DELAY);// Try connecting every x secs
		this.management2.removeAllResourses();

		this.management3 = new ManagementImpl("server-management3");
		this.management3.setSingleThread(true);
		this.management3.start();
        this.management3.setConnectDelay(CONNECT_DELAY);// Try connecting every x secs
		this.management3.removeAllResourses();

		this.server = this.management.addServer(SERVER_NAME, SERVER_HOST, SERVER_PORT, ipChannelType, true, 2, null);
		this.clientAssociation1 = this.management.addAssociation(CLIENT_HOST, CLIENT_PORT1, SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME1, ipChannelType,
				null);
		this.clientAssociation2 = this.management2.addAssociation(CLIENT_HOST, CLIENT_PORT2, SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME2, ipChannelType,
				null);
		this.clientAssociation3 = this.management3.addAssociation(CLIENT_HOST, CLIENT_PORT3, SERVER_HOST, SERVER_PORT, CLIENT_ASSOCIATION_NAME3, ipChannelType,
				null);
	}
 
源代码28 项目: sctp   文件: SelectorThread.java
private void finishConnection(SelectionKey key) throws IOException{
	AssociationImpl association = (AssociationImpl) key.attachment();
	if (association.getIpChannelType() == IpChannelType.SCTP)
		this.finishConnectionSctp(key);
	else
		this.finishConnectionTcp(key);
}
 
源代码29 项目: sctp   文件: SctpTransferTest.java
/**
 * Simple test that creates Client and Server Association, exchanges data
 * and brings down association. Finally removes the Associations and Server
 */
@Test(groups = { "functional", "sctp" })
public void testDataTransferSctp() throws Exception {

	if (SctpTransferTest.checkSctpEnabled())
		this.testDataTransferByProtocol(IpChannelType.SCTP);
}
 
源代码30 项目: sctp   文件: ServerImpl.java
/**
 * @param name
 * @param ip
 * @param port
 * @throws IOException
 */
public ServerImpl(String name, String hostAddress, int hostport, IpChannelType ipChannelType, boolean acceptAnonymousConnections,
		int maxConcurrentConnectionsCount, String[] extraHostAddresses) throws IOException {
	super();
	this.name = name;
	this.hostAddress = hostAddress;
	this.hostport = hostport;
	this.ipChannelType = ipChannelType;
	this.acceptAnonymousConnections = acceptAnonymousConnections;
	this.maxConcurrentConnectionsCount = maxConcurrentConnectionsCount;
	this.extraHostAddresses = extraHostAddresses;
}