-int client(int argc,char *argv[]) {
- xbt_ex_t e;
- gras_socket_t toserver=NULL; /* peer */
+static xbt_socket_t try_gras_socket_client(const char *host, int port)
+{
+ volatile xbt_socket_t sock = NULL;
+ xbt_ex_t e;
+ TRY {
+ sock = gras_socket_client(host, port);
+ }
+ CATCH(e) {
+ if (e.category != system_error)
+ /* dunno what happened, let the exception go through */
+ RETHROWF("Unable to connect to the server: %s");
+ xbt_ex_free(e);
+ }
+ return sock;
+}
+
+int client(int argc, char *argv[])
+{
+ xbt_socket_t toserver = NULL; /* peer */