Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
pankaj
2014-10-09 14:10:03 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9d7e4be4af32de4d6295f410d04b8ef51a1057c0
9d7e4be4
1 parent
f1a2d0ed
Add port as for simple-netty-server
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServer.java
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServerCommand.java
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServer.java
View file @
9d7e4be
...
...
@@ -18,7 +18,8 @@ import org.slf4j.LoggerFactory;
}
public
static
void
startStandalone
(
String
[]
args
)
throws
Exception
{
NettyMessagingService
server
=
new
NettyMessagingService
(
8081
);
int
port
=
args
.
length
>
0
?
Integer
.
parseInt
(
args
[
0
])
:
8081
;
NettyMessagingService
server
=
new
NettyMessagingService
(
port
);
server
.
activate
();
server
.
registerHandler
(
"simple"
,
new
NettyLoggingHandler
());
server
.
registerHandler
(
"echo"
,
new
NettyEchoHandler
());
...
...
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServerCommand.java
View file @
9d7e4be
...
...
@@ -14,22 +14,15 @@ import org.onlab.onos.cli.AbstractShellCommand;
public
class
SimpleNettyServerCommand
extends
AbstractShellCommand
{
//FIXME: Replace these with parameters for
@Argument
(
index
=
0
,
name
=
"
serverIp"
,
description
=
"Server IP address
"
,
@Argument
(
index
=
0
,
name
=
"
port"
,
description
=
"Port to listen
"
,
required
=
false
,
multiValued
=
false
)
String
serverIp
=
"127.0.0.
1"
;
String
port
=
"808
1"
;
@Argument
(
index
=
1
,
name
=
"workers"
,
description
=
"IO workers"
,
required
=
false
,
multiValued
=
false
)
String
workers
=
"6"
;
@Argument
(
index
=
2
,
name
=
"messageLength"
,
description
=
"Message length (bytes)"
,
required
=
false
,
multiValued
=
false
)
String
messageLength
=
"128"
;
@Override
protected
void
execute
()
{
try
{
startStandalone
(
new
String
[]{
serverIp
,
workers
,
messageLength
});
startStandalone
(
new
String
[]{
port
});
}
catch
(
Exception
e
)
{
error
(
"Unable to start server %s"
,
e
);
}
...
...
Please
register
or
login
to post a comment