diff options
| author | Jay Sorg <jay.sorg@gmail.com> | 2014-01-21 01:45:30 -0800 |
|---|---|---|
| committer | Jay Sorg <jay.sorg@gmail.com> | 2014-01-21 01:45:30 -0800 |
| commit | 055c577f5497b55fd7bb597c7303aa1236b39d61 (patch) | |
| tree | 666835d385b29c33f17c97dcc74f2f215f1d3afa /xorg/server/module/rdpMisc.c | |
| parent | 147ace738233435408df18415c7d802631f7fecc (diff) | |
| download | xrdp-proprietary-055c577f5497b55fd7bb597c7303aa1236b39d61.tar.gz xrdp-proprietary-055c577f5497b55fd7bb597c7303aa1236b39d61.zip | |
xorg: work on xorg driver
Diffstat (limited to 'xorg/server/module/rdpMisc.c')
| -rw-r--r-- | xorg/server/module/rdpMisc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/xorg/server/module/rdpMisc.c b/xorg/server/module/rdpMisc.c index 1f0c4c51..653342fe 100644 --- a/xorg/server/module/rdpMisc.c +++ b/xorg/server/module/rdpMisc.c @@ -66,6 +66,34 @@ rdpBitsPerPixel(int depth) /* the g_ functions from os_calls.c */ /*****************************************************************************/ +/* wait 'millis' milliseconds for the socket to be able to receive */ +/* returns boolean */ +int +g_sck_can_recv(int sck, int millis) +{ + fd_set rfds; + struct timeval time; + int rv; + + time.tv_sec = millis / 1000; + time.tv_usec = (millis * 1000) % 1000000; + FD_ZERO(&rfds); + + if (sck > 0) + { + FD_SET(((unsigned int)sck), &rfds); + rv = select(sck + 1, &rfds, 0, 0, &time); + + if (rv > 0) + { + return 1; + } + } + + return 0; +} + +/*****************************************************************************/ int g_sck_recv(int sck, void *ptr, int len, int flags) { |
