7 Copyright (C) 2009, Nicolas VIVIEN
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRYJDWP_JDWP_H__
23 #define __BARRYJDWP_JDWP_H__
29 // forward declarations
34 /// \addtogroup exceptions
37 /// Thrown on low level JDWP errors.
38 class BXEXPORT Error
: public Barry::Error
43 Error(const std::string
&str
);
44 Error(int errcode
, const std::string
&str
);
46 // can return 0 in some case, if unknown error code
47 int errcode() const { return m_errcode
; }
50 class BXEXPORT Timeout
: public Error
53 Timeout(const std::string
&str
) : Error(str
) {}
54 Timeout(int errcode
, const std::string
&str
)
55 : Error(errcode
, str
) {}
73 bool Read(int socket
, Barry::Data
&data
, int timeout
= -1);
74 bool Write(int socket
, const Barry::Data
&data
, int timeout
= -1);
75 bool Write(int socket
, const void *data
, size_t size
, int timeout
= -1);
78 }} // namespace Barry::JDWP