You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2008/06/11 03:02:03 UTC

svn commit: r666449 - /incubator/thrift/trunk/lib/alterl/src/thrift_client.erl

Author: dreiss
Date: Tue Jun 10 18:02:03 2008
New Revision: 666449

URL: http://svn.apache.org/viewvc?rev=666449&view=rev
Log:
erlang thrift_client: wrap gen_tcp:connect in a catch ... leave nothing to chance

Modified:
    incubator/thrift/trunk/lib/alterl/src/thrift_client.erl

Modified: incubator/thrift/trunk/lib/alterl/src/thrift_client.erl
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/alterl/src/thrift_client.erl?rev=666449&r1=666448&r2=666449&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/alterl/src/thrift_client.erl (original)
+++ incubator/thrift/trunk/lib/alterl/src/thrift_client.erl Tue Jun 10 18:02:03 2008
@@ -71,7 +71,7 @@
                   {nodelay, true}],
     TcpTimeout = State#state.connect_timeout,
 
-    case gen_tcp:connect(Host, Port, TcpOptions, TcpTimeout) of
+    case catch gen_tcp:connect(Host, Port, TcpOptions, TcpTimeout) of
         {ok, Sock} ->
             {ok, Transport} = thrift_socket_transport:new(Sock),
             {ok, BufTransport} =
@@ -80,8 +80,8 @@
                     false -> thrift_buffered_transport:new(Transport)
                 end,
             {ok, Protocol} = thrift_binary_protocol:new(BufTransport,
-                                 [{strict_read,  State#state.strict_read},
-                                  {strict_write, State#state.strict_write}]),
+                                                        [{strict_read,  State#state.strict_read},
+                                                         {strict_write, State#state.strict_write}]),
 
             {ok, State#state{service  = Service,
                              protocol = Protocol,