Skip to content

Commit

Permalink
Updates after reviews.
Browse files Browse the repository at this point in the history
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Jul 19, 2021
1 parent ff2729b commit d1797e8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ public void configureConnector() throws Exception
int selectors = 1;

// Create a ServerConnector instance.
ServerConnector connector = new ServerConnector(server, 1, 1, new HttpConnectionFactory());
ServerConnector connector = new ServerConnector(server, acceptors, selectors, new HttpConnectionFactory());

// Configure IP parameters.
// Configure TCP/IP parameters.

// The IP port to listen to.
// The port to listen to.
connector.setPort(8080);
// The IP address to bind to.
// The address to bind to.
connector.setHost("127.0.0.1");

// The TCP accept queue size.
Expand All @@ -194,7 +194,7 @@ public void configureConnectorUnix() throws Exception
int selectors = 1;

// Create a ServerConnector instance.
UnixDomainServerConnector connector = new UnixDomainServerConnector(server, 1, 1, new HttpConnectionFactory());
UnixDomainServerConnector connector = new UnixDomainServerConnector(server, acceptors, selectors, new HttpConnectionFactory());

// Configure Unix-Domain parameters.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.jetty.io.ClientConnectionFactory;
import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.ProcessorUtils;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.slf4j.Logger;
Expand All @@ -43,7 +44,7 @@ public class HttpClientTransportOverHTTP extends AbstractConnectorHttpClientTran

public HttpClientTransportOverHTTP()
{
this(1);
this(Math.max(1, ProcessorUtils.availableProcessors() / 2));
}

public HttpClientTransportOverHTTP(int selectors)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,7 @@ public static Factory forUnixDomain(Path path)
try
{
ProtocolFamily family = Enum.valueOf(StandardProtocolFamily.class, "UNIX");
Class<?> channelClass = Class.forName("java.nio.channels.SocketChannel");
SocketChannel socketChannel = (SocketChannel)channelClass.getMethod("open", ProtocolFamily.class).invoke(null, family);
SocketChannel socketChannel = (SocketChannel)SocketChannel.class.getMethod("open", ProtocolFamily.class).invoke(null, family);
Class<?> addressClass = Class.forName("java.net.UnixDomainSocketAddress");
SocketAddress socketAddress = (SocketAddress)addressClass.getMethod("of", Path.class).invoke(null, path);
return new SocketChannelWithAddress(socketChannel, socketAddress);
Expand All @@ -451,7 +450,7 @@ public static Factory forUnixDomain(Path path)
* destination socket address given as input.</p>
* <p>The return type is a pair/record holding the socket channel and the
* socket address, with the socket channel not yet connected.
* The implementation of this methos must not call
* The implementation of this methods must not call
* {@link SocketChannel#connect(SocketAddress)}, as this is done later,
* after configuring the socket, by the {@link ClientConnector} implementation.</p>
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[description]
Enables support for Java 16 Unix-Domain server sockets.
Enables support for clear-text HTTP/1.1 over Java 16 Unix-Domain server sockets.

[tag]
connector
Expand All @@ -12,7 +12,7 @@ server
lib/jetty-unixdomain-server-*.jar

[xml]
etc/jetty-unixdomain.xml
etc/jetty-unixdomain-http.xml

[ini-template]
# tag::documentation[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ public void testUnixDomain() throws Exception
.mavenLocalRepository(System.getProperty("mavenRepoPath"))
.build();

try (JettyHomeTester.Run run1 = distribution.start("--add-modules=unixdomain"))
try (JettyHomeTester.Run run1 = distribution.start("--add-modules=unixdomain-http"))
{
assertTrue(run1.awaitFor(10, TimeUnit.SECONDS));
assertEquals(0, run1.getExitValue());
Expand Down

0 comments on commit d1797e8

Please sign in to comment.