示例#1
0
void checkResponse(net::Socket& socket) throw (Exception)
{
  iostream::XdrInputStream& istream = socket.getXdrInputStream();

  int responseType = 0;
  istream.read(responseType);

  if (responseType == net::MessageProtocol::ERROR) {
    throw Exception("Exception has occurred");
  } else if (responseType != net::MessageProtocol::REPLY) {
    throw Exception("Internal implementation error");
  }
}
示例#2
0
void checkResponse(net::Socket& socket) throw (Exception)
{
  iostream::XdrInputStream& istream = socket.getXdrInputStream();

  int responseType = 0;
  istream.read(responseType);

  if (responseType == net::MessageProtocol::ERROR) {
    throw Exception();
  } else if (responseType != net::MessageProtocol::REPLY) {
    throw Exception();
  }
}