RuneHive-Game
Loading...
Searching...
No Matches
dev.advo.fs.net.FileServerHandler Class Reference
Inheritance diagram for dev.advo.fs.net.FileServerHandler:
Collaboration diagram for dev.advo.fs.net.FileServerHandler:

Public Member Functions

void channelIdle (ChannelHandlerContext ctx, IdleStateEvent e) throws Exception
void exceptionCaught (ChannelHandlerContext ctx, ExceptionEvent e) throws Exception
void messageReceived (ChannelHandlerContext ctx, MessageEvent e) throws Exception

Static Private Attributes

static final Logger logger = Logger.getLogger(FileServerHandler.class.getName())

Detailed Description

Definition at line 17 of file FileServerHandler.java.

Member Function Documentation

◆ channelIdle()

void dev.advo.fs.net.FileServerHandler.channelIdle ( ChannelHandlerContext ctx,
IdleStateEvent e ) throws Exception

Definition at line 22 of file FileServerHandler.java.

22 {
23// System.out.println("Closing channel due to idle msg received.");
24// e.getChannel().close();
25 }

◆ exceptionCaught()

void dev.advo.fs.net.FileServerHandler.exceptionCaught ( ChannelHandlerContext ctx,
ExceptionEvent e ) throws Exception

Definition at line 46 of file FileServerHandler.java.

46 {
47// logger.log(Level.SEVERE, "Exception occured, closing channel...", e.getCause());
48// System.out.println("Closing channel due to incorrect msg received.");
49// e.getChannel().close();
50 }

◆ messageReceived()

void dev.advo.fs.net.FileServerHandler.messageReceived ( ChannelHandlerContext ctx,
MessageEvent e ) throws Exception

Definition at line 28 of file FileServerHandler.java.

28 {
29 Object msg = e.getMessage();
30 if (msg instanceof ServiceRequest) {
31 ServiceRequest request = (ServiceRequest) msg;
32 if (request.invalid()) {
33 // System.out.println("Closing channel due to incorrect msg received. ");
34 // e.getChannel().close();
35 } else {
36 e.getChannel().write(new ServiceResponse());
37 }
38 } else if (msg instanceof OnDemandRequest) {
39 RequestDispatcher.dispatch(e.getChannel(), (OnDemandRequest) msg);
40 } else {
41 throw new Exception("unknown message type");
42 }
43 }

References dev.advo.fs.dispatch.RequestDispatcher.dispatch(), and dev.advo.fs.net.service.ServiceRequest.invalid().

Here is the call graph for this function:

Member Data Documentation

◆ logger

final Logger dev.advo.fs.net.FileServerHandler.logger = Logger.getLogger(FileServerHandler.class.getName())
staticprivate

Definition at line 19 of file FileServerHandler.java.


The documentation for this class was generated from the following file: