Phil wrote:
>The Wine socket implementation has problems when it comes to select.
>A fix for this problem is not currently on anybody's radar.
> http://www.winehq.org/pipermail/wine-devel/2006-February/044588.html

Hmm.  You never filed a bug at http://bugs.winehq.org
for this, it seems.  Could you, please?

Incidentally, I ported your test app to Unix, and on
Linux, it prints out THIS IS WINE.
I'm not sure why you can't adapt your code to deal
with the difference in select behavior -- is the problem
third party code you have no source for?
- Dan
#include <sys/select.h>
#include <netinet/in.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
    int fd;

    fd = socket(AF_INET, SOCK_STREAM, 0);
    if (fd != -1) {
	fd_set readfds;
	struct timeval select_timeout;

	FD_ZERO(&readfds);
	FD_SET(fd, &readfds);
	select_timeout.tv_sec = 2;
	select_timeout.tv_usec = 0;

	if (select((int) fd + 1, &readfds, NULL, NULL, &select_timeout) !=
	    -1) {
	    if (FD_ISSET(fd, &readfds))
		printf("THIS IS WINE\n");
	    else
		printf("THIS IS WINDOWS\n");
	} else
	    printf("got a socket error\n");

	close(fd);
    }
    return 0;
}


Reply via email to