Example #1
0
static gint socket_fd_recv(gint fd, gchar *buf, gint len, gint flags)
{
	if (socket_fd_check_io(fd, G_IO_IN) < 0)
		return -1;

	return recv(fd, buf, len, flags);
}
Example #2
0
gint socket_fd_write(gint fd, const gchar *buf, gint len)
{
	if (socket_fd_check_io(fd, G_IO_OUT) < 0)
		return -1;

#ifdef G_OS_WIN32
	return send(fd, buf, len, 0);
#else
	return write(fd, buf, len);
#endif
}
Example #3
0
static gint socket_fd_read(gint fd, gchar *buf, gint len)
{
	if (socket_fd_check_io(fd, G_IO_IN) < 0)
		return -1;

#ifdef G_OS_WIN32
	return recv(fd, buf, len, 0);
#else
	return read(fd, buf, len);
#endif
}
Example #4
0
gint socket_fd_write(gint fd, const gchar *buf, gint len)
{
    if (socket_fd_check_io(fd, G_IO_OUT) < 0)
        return -1;
    return write(fd, buf, len);
}
Example #5
0
static gint socket_fd_read(gint fd, gchar *buf, gint len)
{
    if (socket_fd_check_io(fd, G_IO_IN) < 0)
        return -1;
    return read(fd, buf, len);
}