![]() |
|
|
#include <agentserver.h>
Collaboration diagram for inspectorj::agent::AgentServer:
The server is started in the agent's VM INIT callback. The server will accept exactly one inspectorJ client at a time.
Definition at line 53 of file agentserver.h.
Public Member Functions | |
AgentServer (int portNum, AgentPacketHandler *) | |
Constructor. | |
~AgentServer () | |
Destructor. | |
void | start () |
Start the server. | |
void | stop () |
Stop the server. | |
bool | isStarted () |
Returns true if the server is started. | |
Protected Member Functions | |
void | shutDown () |
bool | checkError (boost::system::error_code &) |
Check to see if an error has occurred. | |
Protected Attributes | |
int | portNum |
AgentPacketHandler * | pktHandler |
volatile bool | quit |
volatile bool | started |
boost::system::error_code * | error |
tcp::socket * | socket |
tcp::acceptor * | acceptor |
AgentSocket * | agentSocket |
inspectorj::agent::AgentServer::AgentServer | ( | int | portNum, | |
AgentPacketHandler * | handler | |||
) |
Constructor.
portNum | The port number that the server will listen on. | |
handler | The AgentPacketHandler to handle client commands |
Definition at line 40 of file agentserver.cpp.
inspectorj::agent::AgentServer::~AgentServer | ( | ) |
Destructor.
Definition at line 56 of file agentserver.cpp.
References agentSocket, error, and socket.
void inspectorj::agent::AgentServer::start | ( | ) |
Start the server.
This will cause the server to start listening for a client connection. Once attached, the server will begin processing commands.
Definition at line 114 of file agentserver.cpp.
References acceptor, agentSocket, inspectorj::agent::AgentPacketHandler::attachCurrentThreadToVM(), checkError(), inspectorj::agent::AgentLogger::error(), error, inspectorj::agent::AgentLogger::info(), inspectorj::jdwp::JDWP_HANDSHAKE, inspectorj::jdwp::JDWP_HANDSHAKE_LENGTH, inspectorj::jdwp::JDWP_HEADER_LENGTH, pktHandler, portNum, inspectorj::agent::AgentPacketHandler::processCommand(), quit, inspectorj::agent::AgentSocket::read(), inspectorj::agent::AgentPacketHandler::setAgentSocket(), shutDown(), socket, started, and inspectorj::agent::AgentLogger::warn().
Referenced by startServer().
void inspectorj::agent::AgentServer::stop | ( | ) |
Stop the server.
This is a no-op if the server is not running.
Definition at line 75 of file agentserver.cpp.
References acceptor, quit, and socket.
Referenced by Agent_OnUnload().
bool inspectorj::agent::AgentServer::isStarted | ( | ) |
Returns true if the server is started.
Definition at line 105 of file agentserver.cpp.
References started.
Referenced by Agent_OnUnload().
bool inspectorj::agent::AgentServer::checkError | ( | boost::system::error_code & | error | ) | [protected] |
Check to see if an error has occurred.
error | The boost::system::error_code to check |
Definition at line 256 of file agentserver.cpp.
Referenced by start().