00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00027 #ifndef IJ_AGENT_AGENTSOCKET_H
00028 #define IJ_AGENT_AGENTSOCKET_H
00029
00030 #include "inspectorj/agent/agentutils.h"
00031 #include "inspectorj/jdwp/jdwpreply.h"
00032 #include <boost/asio.hpp>
00033 #include <boost/bind.hpp>
00034 #include <boost/function.hpp>
00035
00036
00037 using boost::asio::ip::tcp;
00038 using inspectorj::jdwp::JDWPReply;
00039
00040 namespace inspectorj {
00041 namespace agent {
00042
00048 class AgentSocket
00049 {
00050
00051 public:
00052 AgentSocket(tcp::socket* socket, boost::system::error_code* error);
00053
00054 bool read(jint &i);
00055 bool read(jbyte &j);
00056 bool read(char *ch, int len);
00057 bool write(jint i);
00058 bool write(short s);
00059 bool write(jbyte j);
00060 bool writeReply(JDWPReply*);
00061
00062
00063 private:
00064 boost::asio::ip::tcp::socket* socket;
00065 boost::system::error_code* error;
00066
00067
00068 };
00069
00070 }
00071 }
00072
00073 #endif // IJ_AGENT_AGENTSOCKET_H