1 20 package org.apache.mina.transport.socket.nio; 21 22 import java.net.InetSocketAddress ; 23 import java.net.SocketAddress ; 24 25 import org.apache.mina.common.ConnectFuture; 26 import org.apache.mina.common.IoConnector; 27 import org.apache.mina.common.IoHandler; 28 import org.apache.mina.transport.AbstractTrafficControlTest; 29 30 37 public class SocketTrafficControlTest extends AbstractTrafficControlTest { 38 39 public SocketTrafficControlTest() { 40 super(new SocketAcceptor()); 41 } 42 43 protected ConnectFuture connect(int port, IoHandler handler) 44 throws Exception { 45 IoConnector connector = new SocketConnector(); 46 SocketAddress addr = new InetSocketAddress ("localhost", port); 47 return connector.connect(addr, handler); 48 } 49 50 protected SocketAddress createServerSocketAddress(int port) { 51 return new InetSocketAddress (port); 52 } 53 54 } 55 | Popular Tags |