equal
deleted
inserted
replaced
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 |
40 #include <gst/gst-i18n-plugin.h> |
43 #include <gst/gst-i18n-plugin.h> |
|
44 #endif |
41 |
45 |
42 GST_DEBUG_CATEGORY_EXTERN (tcp_debug); |
46 GST_DEBUG_CATEGORY_EXTERN (tcp_debug); |
43 #define GST_CAT_DEFAULT tcp_debug |
47 #define GST_CAT_DEFAULT tcp_debug |
44 |
48 |
45 #ifndef MSG_NOSIGNAL |
49 #ifndef MSG_NOSIGNAL |
120 while (bytes_written < count) { |
124 while (bytes_written < count) { |
121 ssize_t wrote = send (socket, (const char *) buf + bytes_written, |
125 ssize_t wrote = send (socket, (const char *) buf + bytes_written, |
122 count - bytes_written, MSG_NOSIGNAL); |
126 count - bytes_written, MSG_NOSIGNAL); |
123 |
127 |
124 if (wrote <= 0) { |
128 if (wrote <= 0) { |
125 GST_WARNING ("error while writing"); |
|
126 return bytes_written; |
129 return bytes_written; |
127 } |
130 } |
128 bytes_written += wrote; |
131 bytes_written += wrote; |
129 } |
132 } |
130 |
133 |
131 GST_LOG ("wrote %" G_GSIZE_FORMAT " bytes succesfully", bytes_written); |
134 if (bytes_written < 0) |
|
135 GST_WARNING ("error while writing"); |
|
136 else |
|
137 GST_LOG ("wrote %" G_GSIZE_FORMAT " bytes succesfully", bytes_written); |
132 return bytes_written; |
138 return bytes_written; |
133 } |
139 } |
134 |
140 |
135 /* atomically read count bytes into buf, cancellable. return val of GST_FLOW_OK |
141 /* atomically read count bytes into buf, cancellable. return val of GST_FLOW_OK |
136 * indicates success, anything else is failure. |
142 * indicates success, anything else is failure. |