[gtk-vnc-devel] [PATCH 2/4] Use recv/send instead of read/write on sockets
- From: "Richard W.M. Jones" <rjones redhat com>
- To: gtk-vnc-devel lists sourceforge net
- Subject: [gtk-vnc-devel] [PATCH 2/4] Use recv/send instead of read/write on sockets
- Date: Wed, 29 Oct 2008 15:02:42 +0000
(This fix comes from Dan Berrange).
Use the Win32 recv/send calls instead of read/write for sockets. On
POSIX platforms this change makes no difference.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
diff -r 47135c91cd9c src/gvnc.c
--- a/src/gvnc.c Thu Oct 09 11:23:09 2008 -0400
+++ b/src/gvnc.c Wed Oct 29 14:51:17 2008 +0000
@@ -380,7 +380,7 @@
ret = -1;
}
} else
- ret = read(fd, gvnc->read_buffer, 4096);
+ ret = recv (fd, gvnc->read_buffer, 4096, 0);
if (ret == -1) {
switch (errno) {
@@ -439,9 +439,9 @@
ret = -1;
}
} else
- ret = write(fd,
+ ret = send (fd,
gvnc->write_buffer+offset,
- gvnc->write_offset-offset);
+ gvnc->write_offset-offset, 0);
if (ret == -1) {
switch (errno) {
case EWOULDBLOCK:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]