Summary: ALREADY_OPEN
Reviewed By: aditya
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665010 
13f79535-47bb-0310-9956-
ffa450edef68
 
 }
 
 void TSocket::open() {
+  if (isOpen()) {
+    throw TTransportException(TTransportException::ALREADY_OPEN);
+  }
+
   // Create socket
   socket_ = socket(AF_INET, SOCK_STREAM, 0);
   if (socket_ == -1) {
 
   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() :