gst_plugins_base/gst/tcp/gsttcp.c
changeset 16 8e837d1bf446
parent 0 0e761a78d257
child 30 7e817e7e631c
equal deleted inserted replaced
15:4b0c6ed43234 16:8e837d1bf446
    35 #ifdef HAVE_FIONREAD_IN_SYS_FILIO
    35 #ifdef HAVE_FIONREAD_IN_SYS_FILIO
    36 #include <sys/filio.h>
    36 #include <sys/filio.h>
    37 #endif
    37 #endif
    38 
    38 
    39 #include "gsttcp.h"
    39 #include "gsttcp.h"
    40 #ifdef __SYMBIAN32__
       
    41 #include "gst/gst-i18n-plugin.h"
       
    42 #else
       
    43 #include <gst/gst-i18n-plugin.h>
    40 #include <gst/gst-i18n-plugin.h>
    44 #endif
       
    45 
    41 
    46 GST_DEBUG_CATEGORY_EXTERN (tcp_debug);
    42 GST_DEBUG_CATEGORY_EXTERN (tcp_debug);
    47 #define GST_CAT_DEFAULT tcp_debug
    43 #define GST_CAT_DEFAULT tcp_debug
    48 
    44 
    49 #ifndef MSG_NOSIGNAL
    45 #ifndef MSG_NOSIGNAL
   124   while (bytes_written < count) {
   120   while (bytes_written < count) {
   125     ssize_t wrote = send (socket, (const char *) buf + bytes_written,
   121     ssize_t wrote = send (socket, (const char *) buf + bytes_written,
   126         count - bytes_written, MSG_NOSIGNAL);
   122         count - bytes_written, MSG_NOSIGNAL);
   127 
   123 
   128     if (wrote <= 0) {
   124     if (wrote <= 0) {
       
   125       GST_WARNING ("error while writing");
   129       return bytes_written;
   126       return bytes_written;
   130     }
   127     }
   131     bytes_written += wrote;
   128     bytes_written += wrote;
   132   }
   129   }
   133 
   130 
   134   if (bytes_written < 0)
   131   GST_LOG ("wrote %" G_GSIZE_FORMAT " bytes succesfully", bytes_written);
   135     GST_WARNING ("error while writing");
       
   136   else
       
   137     GST_LOG ("wrote %" G_GSIZE_FORMAT " bytes succesfully", bytes_written);
       
   138   return bytes_written;
   132   return bytes_written;
   139 }
   133 }
   140 
   134 
   141 /* atomically read count bytes into buf, cancellable. return val of GST_FLOW_OK
   135 /* atomically read count bytes into buf, cancellable. return val of GST_FLOW_OK
   142  * indicates success, anything else is failure.
   136  * indicates success, anything else is failure.