mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
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:
parent
5e0465738e
commit
a9848d7618
@ -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) {
|
||||
|
@ -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() :
|
||||
|
Loading…
Reference in New Issue
Block a user