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-07 13:52:24 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
09b583854ddeb50816a6cb22697f1867bd952c5c
09b58385
1 parent
35e7837a
Added simple netty server
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServer.java
apps/foo/src/main/java/org/onlab/onos/foo/SimpleNettyServer.java
0 → 100644
View file @
09b5838
package
org
.
onlab
.
onos
.
foo
;
import
java.io.IOException
;
import
org.jboss.netty.handler.logging.LoggingHandler
;
import
org.onlab.netty.EchoHandler
;
import
org.onlab.netty.KryoSerializer
;
import
org.onlab.netty.NettyMessagingService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* Test to measure Messaging performance.
*/
public
class
SimpleNettyServer
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
IOLoopTestServer
.
class
);
private
SimpleNettyServer
()
{}
public
static
void
main
(
String
...
args
)
throws
Exception
{
startStandalone
(
args
);
System
.
exit
(
0
);
}
public
static
void
startStandalone
(
String
[]
args
)
throws
IOException
{
NettyMessagingService
server
=
new
NettyMessagingService
(
8080
);
try
{
server
.
activate
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
server
.
setSerializer
(
new
KryoSerializer
());
server
.
registerHandler
(
"simple"
,
(
org
.
onlab
.
netty
.
MessageHandler
)
new
LoggingHandler
());
server
.
registerHandler
(
"echo"
,
new
EchoHandler
());
}
}
Please
register
or
login
to post a comment