axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From din...@apache.org
Subject svn commit: r558272 - /webservices/axis2/scratch/c/dinesh/602/c/src/core/transport/tcp/sender/tcp_transport_sender.c
Date Sat, 21 Jul 2007 09:00:20 GMT
Author: dinesh
Date: Sat Jul 21 02:00:20 2007
New Revision: 558272

URL: http://svn.apache.org/viewvc?view=rev&rev=558272
Log:
using svr_conn_open and svr_conn_close for connection

Modified:
    webservices/axis2/scratch/c/dinesh/602/c/src/core/transport/tcp/sender/tcp_transport_sender.c

Modified: webservices/axis2/scratch/c/dinesh/602/c/src/core/transport/tcp/sender/tcp_transport_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/scratch/c/dinesh/602/c/src/core/transport/tcp/sender/tcp_transport_sender.c?view=diff&rev=558272&r1=558271&r2=558272
==============================================================================
--- webservices/axis2/scratch/c/dinesh/602/c/src/core/transport/tcp/sender/tcp_transport_sender.c
(original)
+++ webservices/axis2/scratch/c/dinesh/602/c/src/core/transport/tcp/sender/tcp_transport_sender.c
Sat Jul 21 02:00:20 2007
@@ -42,13 +42,13 @@
     int so_timeout;
 
 }
-axis2_tcp_transport_sender_impl_t;
+    axis2_tcp_transport_sender_impl_t;
 
 #define AXIS2_WS_RM_ANONYMOUS_URL "tcp://docs.oasis-open.org/ws-rx/wsmc/200702/anonymous?id="
 
-#define AXIS2_INTF_TO_IMPL(transport_sender) \
-                         ((axis2_tcp_transport_sender_impl_t *)\
-                     (transport_sender))
+#define AXIS2_INTF_TO_IMPL(transport_sender)    \
+    ((axis2_tcp_transport_sender_impl_t *)      \
+     (transport_sender))
 
 /***************************** Function headers *******************************/
 axis2_status_t AXIS2_CALL
@@ -99,8 +99,8 @@
     AXIS2_ENV_CHECK(env, NULL);
 
     transport_sender_impl = (axis2_tcp_transport_sender_impl_t *)AXIS2_MALLOC
-            (env->allocator, sizeof(
-                        axis2_tcp_transport_sender_impl_t));
+        (env->allocator, sizeof(
+            axis2_tcp_transport_sender_impl_t));
 
     if (! transport_sender_impl)
     {
@@ -121,17 +121,10 @@
     axis2_transport_sender_t *transport_sender,
     const axutil_env_t *env)
 {
-/*     axis2_tcp_transport_sender_impl_t *transport_sender_impl = NULL; */
-/*     AXIS2_ENV_CHECK(env, AXIS2_FAILURE); */
-/*     transport_sender_impl = AXIS2_INTF_TO_IMPL(transport_sender); */
-
-/*     if (transport_sender_impl->tcp_version) */
-/*     { */
-/*         AXIS2_FREE(env->allocator, transport_sender_impl->tcp_version); */
-/*         transport_sender_impl->tcp_version = NULL; */
-/*     } */
-
-/*     AXIS2_FREE(env->allocator, transport_sender_impl); */
+    axis2_tcp_transport_sender_impl_t *transport_sender_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    transport_sender_impl = AXIS2_INTF_TO_IMPL(transport_sender);
+    AXIS2_FREE(env->allocator, transport_sender_impl);
     return;
 }
 
@@ -149,7 +142,7 @@
     axiom_soap_envelope_t *soap_envelope = NULL;
     axiom_xml_writer_t *xml_writer = NULL;
     axiom_output_t *om_output = NULL;
-    const axis2_char_t *buffer = NULL;
+    axis2_char_t *buffer = NULL;
     axutil_stream_t *out_stream = NULL;
     int buffer_size = 0;
 
@@ -190,7 +183,7 @@
         return AXIS2_FAILURE;
     }
     buffer_size = axiom_xml_writer_get_xml_size (xml_writer, env);
-
+    buffer [buffer_size] = 0;
     if (is_server)
     {
         out_stream = axis2_msg_ctx_get_transport_out_stream (msg_ctx, env);
@@ -232,17 +225,17 @@
                              "unable to convert epr to string");
             return AXIS2_FAILURE;
         }
-
+            
         to_url = axutil_url_parse_string (env, to_str);
-
+            
         if (!to_url)
         {
             AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
                              "unable to parser string to url");
             return AXIS2_FAILURE;
         }
-
-
+            
+            
         host = axutil_url_get_server (to_url, env);
         if (!host)
         {
@@ -250,7 +243,7 @@
                              "retrieving host failed");
             return AXIS2_FAILURE;
         }
-
+            
         port = axutil_url_get_port (to_url, env);
         if (!port)
         {
@@ -258,9 +251,6 @@
                              "retrieving port failed");
             return AXIS2_FAILURE;
         }
-
-        AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI, "host:%s port:%d",host, port);
-
         socket = axutil_network_handler_open_socket (env, host, port);
         if (!socket)
         {
@@ -268,6 +258,9 @@
             return AXIS2_FAILURE;
         }
 
+        AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI, 
+                         "open socket for host:%s port:%d",host, port);
+            
         stream = axutil_stream_create_socket (env, socket);
         if (!stream)
         {
@@ -299,12 +292,12 @@
             memcpy (res_buffer + res_size, buff, 1);
             res_size ++;
         }
-
+        
         reader = axiom_xml_reader_create_for_memory(
             env, res_buffer, res_size, 
             NULL, 
             AXIS2_XML_PARSER_TYPE_BUFFER);
-
+        
         if (!reader)
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
@@ -376,8 +369,8 @@
     AXIS2_PARAM_CHECK(env->error, out_desc, AXIS2_FAILURE);
 
     temp_param = axutil_param_container_get_param(
-                axis2_transport_out_desc_param_container(out_desc, env), env,
-                AXIS2_TCP_SO_TIMEOUT);
+        axis2_transport_out_desc_param_container(out_desc, env), env,
+        AXIS2_TCP_SO_TIMEOUT);
     if (temp_param)
     {
         temp = axutil_param_get_value(temp_param, env);
@@ -387,8 +380,8 @@
         AXIS2_INTF_TO_IMPL(transport_sender)->so_timeout = AXIS2_ATOI(temp);
     }
     temp = (axis2_char_t *)axutil_param_container_get_param(
-                axis2_transport_out_desc_param_container(out_desc, env), env,
-                AXIS2_TCP_CONNECTION_TIMEOUT);
+        axis2_transport_out_desc_param_container(out_desc, env), env,
+        AXIS2_TCP_CONNECTION_TIMEOUT);
     if (temp_param)
     {
         temp = axutil_param_get_value(temp_param, env);
@@ -428,35 +421,35 @@
 #ifndef AXIS2_STATIC_DEPLOY
 axis2_get_instance(
 #else
-axis2_tcp_transport_sender_get_instance(
+    axis2_tcp_transport_sender_get_instance(
 #endif
-    struct axis2_transport_sender **inst,
-    const axutil_env_t *env)
-{
-    *inst = axis2_tcp_transport_sender_create(env);
-    if (!(*inst))
+        struct axis2_transport_sender **inst,
+        const axutil_env_t *env)
     {
-        return AXIS2_FAILURE;
-    }
+        *inst = axis2_tcp_transport_sender_create(env);
+        if (!(*inst))
+        {
+            return AXIS2_FAILURE;
+        }
 
-    return AXIS2_SUCCESS;
-}
+        return AXIS2_SUCCESS;
+    }
 
-AXIS2_EXPORT int
+    AXIS2_EXPORT int
 #ifndef AXIS2_STATIC_DEPLOY
-axis2_remove_instance(
+    axis2_remove_instance(
 #else
-axis2_tcp_transport_sender_remove_instance(
+        axis2_tcp_transport_sender_remove_instance(
 #endif
-    axis2_transport_sender_t *inst,
-    const axutil_env_t *env)
-{
-    if (inst)
-    {
-        AXIS2_TRANSPORT_SENDER_FREE(inst, env);
-    }
-    return AXIS2_SUCCESS;
-}
+            axis2_transport_sender_t *inst,
+            const axutil_env_t *env)
+        {
+            if (inst)
+            {
+                AXIS2_TRANSPORT_SENDER_FREE(inst, env);
+            }
+            return AXIS2_SUCCESS;
+        }
 
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message