Search in sources :

Example 6 with SocketChannelEndPoint

use of org.eclipse.jetty.io.SocketChannelEndPoint in project jetty.project by eclipse.

the class ServerConnector method newEndPoint.

protected ChannelEndPoint newEndPoint(SocketChannel channel, ManagedSelector selectSet, SelectionKey key) throws IOException {
    SocketChannelEndPoint endpoint = new SocketChannelEndPoint(channel, selectSet, key, getScheduler());
    endpoint.setIdleTimeout(getIdleTimeout());
    return endpoint;
}
Also used : SocketChannelEndPoint(org.eclipse.jetty.io.SocketChannelEndPoint)

Example 7 with SocketChannelEndPoint

use of org.eclipse.jetty.io.SocketChannelEndPoint in project athenz by yahoo.

the class JettyConnectionLoggerTest method getMockConnection.

private MockedConnection getMockConnection() throws Exception {
    MockedConnection mockedConnection = new MockedConnection();
    SSLEngine sslEngine = Mockito.mock(SSLEngine.class);
    mockedConnection.sslEngine = sslEngine;
    SslConnection sslConnection = Mockito.mock(SslConnection.class);
    when(sslConnection.getSSLEngine()).thenReturn(sslEngine);
    SocketChannelEndPoint socketChannelEndPoint = Mockito.mock(SocketChannelEndPoint.class);
    when(socketChannelEndPoint.getLocalAddress()).thenReturn(new InetSocketAddress(InetAddress.getLocalHost(), 4444));
    when(socketChannelEndPoint.getRemoteAddress()).thenReturn(new InetSocketAddress(InetAddress.getLocalHost(), 5555));
    when(sslConnection.getEndPoint()).thenReturn(socketChannelEndPoint);
    mockedConnection.endpoint = socketChannelEndPoint;
    mockedConnection.sslConnection = sslConnection;
    return mockedConnection;
}
Also used : SslConnection(org.eclipse.jetty.io.ssl.SslConnection) SSLEngine(javax.net.ssl.SSLEngine) InetSocketAddress(java.net.InetSocketAddress) SocketChannelEndPoint(org.eclipse.jetty.io.SocketChannelEndPoint)

Aggregations

SocketChannelEndPoint (org.eclipse.jetty.io.SocketChannelEndPoint)7 Socket (java.net.Socket)4 IOException (java.io.IOException)3 OutputStream (java.io.OutputStream)3 SelectionKey (java.nio.channels.SelectionKey)3 SocketChannel (java.nio.channels.SocketChannel)3 ManagedSelector (org.eclipse.jetty.io.ManagedSelector)3 ServerConnector (org.eclipse.jetty.server.ServerConnector)3 Test (org.junit.Test)3 InputStream (java.io.InputStream)2 InetSocketAddress (java.net.InetSocketAddress)2 ByteBuffer (java.nio.ByteBuffer)2 ArrayList (java.util.ArrayList)2 Exchanger (java.util.concurrent.Exchanger)2 SSLEngine (javax.net.ssl.SSLEngine)2 ServletException (javax.servlet.ServletException)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 ChannelEndPoint (org.eclipse.jetty.io.ChannelEndPoint)2 SslConnection (org.eclipse.jetty.io.ssl.SslConnection)2