Re: [Simpleweb-Support] How do I cusotmize the port on which my server listens?
Brought to you by:
niallg
From: Dave A. <lar...@ms...> - 2013-04-09 20:18:03
|
Hi, Thanks but I'm not seeing it. Neither the "HelloWorld" example or the "AsynchronousService" seem to change the default port of 8080 on which the server listens. I assume this line SocketAddress address = new InetSocketAddress(8080);refers to connecting to a running server.Which example are you referring to? - Dave Date: Tue, 9 Apr 2013 14:43:43 -0500 From: lma...@sm... To: sim...@li... Subject: Re: [Simpleweb-Support] How do I cusotmize the port on which my server listens? Hi, Here's an example from the tutorial. You might want to read it http://www.simpleframework.org/doc/tutorial/tutorial.php public static void main(String[] list) throws Exception { Container container = new HelloWorld(); Server server = new ContainerServer(container); Connection connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(8080); connection.connect(address); } Regards, Laurent Marchal On 4/9/13 11:38 AM, Dave Alvarado wrote: Hi, I'm using the latest version of the Simple framework. How do I customize the port on which my server listens? It seems to be 8080 by default, but that port is being used by something else on my system. I'm using the server creation from the example: public class TestContainer implements Container { public void handle(Request request, Response response) { try { final PrintStream body = response.getPrintStream(); long time = System.currentTimeMillis(); response.set("Content-Type", "text/plain"); response.set("Server", "Test/1.0 (Simple 4.0)"); response.setDate("Date", time); response.setDate("Last-Modified", time); body.println("Hello World"); body.close(); } catch(Exception e) { e.printStackTrace(); } } } Thanks, - Dave ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |