parameter : port
This commit is contained in:
snoop 2017-05-12 11:27:18 +09:00
parent 093dbee08b
commit ee3701a18c
2 changed files with 13 additions and 4 deletions

View File

@ -57,9 +57,9 @@ public class Server {
return bos.toByteArray();
}
public void start() throws IOException {
public void start(int port) throws IOException {
/* The port on which the server should run */
int port = 50052;
// int port = 50052;
server = ServerBuilder.forPort(port)
.addService(new ConfigImpl())
.addService(new DataImpl())
@ -209,8 +209,17 @@ public class Server {
* Main launches the server from the command line.
*/
public static void main(String[] args) throws IOException, InterruptedException {
if(args.length <= 0) {
System.out.println("Port args");
System.out.println("first parameter is Port Number");
return;
}
int port = Integer.valueOf(args[0]);
final Server server = new Server();
server.start();
server.start(port);
server.blockUntilShutdown();
}
}

View File

@ -39,7 +39,7 @@ public class ServerTest {
public void setUp() throws Exception {
server = new Server();
server.addDelegate(Crawlers.REDIS.name(),new TestCrawlerImpl());
server.start();
server.start(50052);
}
@After