New thrift c++ error code

Summary: ALREADY_OPEN

Reviewed By: aditya


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665010 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Slee 2007-02-21 04:54:05 +00:00
parent 5e0465738e
commit a9848d7618
2 changed files with 7 additions and 2 deletions

View File

@ -98,6 +98,10 @@ bool TSocket::peek() {
}
void TSocket::open() {
if (isOpen()) {
throw TTransportException(TTransportException::ALREADY_OPEN);
}
// Create socket
socket_ = socket(AF_INET, SOCK_STREAM, 0);
if (socket_ == -1) {

View File

@ -23,8 +23,9 @@ class TTransportException : public facebook::thrift::TException {
enum TTransportExceptionType {
UNKNOWN = 0,
NOT_OPEN = 1,
TIMED_OUT = 2,
END_OF_FILE = 3,
ALREADY_OPEN = 2,
TIMED_OUT = 3,
END_OF_FILE = 4,
};
TTransportException() :