#SoupSocket's I/O methods are designed around the idea of
using a single codepath for both synchronous and
asynchronous I/O. If you want to read off a #SoupSocket,
the "correct" way to do it is to call soup_socket_read() or
soup_socket_read_until() repeatedly until you have read
everything you want. If it returns %SOUP_SOCKET_WOULD_BLOCK
at any point, stop reading and wait for it to emit the
#SoupSocket::readable signal. Then go back to the
reading-as-much-as-you-can loop. Likewise, for writing to a
#SoupSocket, you should call soup_socket_write() either
until you have written everything, or it returns
%SOUP_SOCKET_WOULD_BLOCK (in which case you wait for
#SoupSocket::writable and then go back into the loop).
Code written this way will work correctly with both
blocking and non-blocking sockets; blocking sockets will
simply never return %SOUP_SOCKET_WOULD_BLOCK, and so the
code that handles that case just won't get used for them.
Whether or not the socket uses non-blocking I/O.
#SoupSocket's I/O methods are designed around the idea of using a single codepath for both synchronous and asynchronous I/O. If you want to read off a #SoupSocket, the "correct" way to do it is to call soup_socket_read() or soup_socket_read_until() repeatedly until you have read everything you want. If it returns %SOUP_SOCKET_WOULD_BLOCK at any point, stop reading and wait for it to emit the #SoupSocket::readable signal. Then go back to the reading-as-much-as-you-can loop. Likewise, for writing to a #SoupSocket, you should call soup_socket_write() either until you have written everything, or it returns %SOUP_SOCKET_WOULD_BLOCK (in which case you wait for #SoupSocket::writable and then go back into the loop).
Code written this way will work correctly with both blocking and non-blocking sockets; blocking sockets will simply never return %SOUP_SOCKET_WOULD_BLOCK, and so the code that handles that case just won't get used for them.