qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-trivial] Problems with -net socket connect on windows


From: M . Stein
Subject: [Qemu-trivial] Problems with -net socket connect on windows
Date: Wed, 10 Dec 2014 10:18:15 +0100

Hi,

FYI: I had problems with this, the error message was:

connect: No error
D:\usr_win\bin\qemu.exe: -net socket,vlan=0,connect=127.0.0.1:56789: Device 'socket' could not be initialized

I have done it with qemu 0.14 (win7-64/cygwin32/mingw), but the recent code seems to be the same. The Solution
I have googled was, that one have to ignore error WSAEISCONN on windows too.

For me it works now.

net/socket.c net_socket_connect_init:

    connected = 0;
    for(;;) {
        ret = connect(fd, (struct sockaddr *)&saddr, sizeof(saddr));
        if (ret < 0) {
            err = socket_error();
            if (err == EINTR || err == EWOULDBLOCK) {
            } else if (err == EINPROGRESS) {
                break;
#ifdef _WIN32
            } else if (err == WSAEALREADY || err == WSAEINVAL) {
                break;
*** added this lines ***
            } else if (err == WSAEISCONN) {
                fprintf(stderr,"connect: ignore 'already connected' error (on windows)\n");
                break;
*** end added ***
#endif
            } else {
                perror("connect");
                closesocket(fd);
                return -1;
            }
        } else {
            connected = 1;
            break;
        }

Hope, this helps more, than it makes noise.

                                        Regards

                                        Matthias

reply via email to

[Prev in Thread] Current Thread [Next in Thread]