Strange behaviour with class wxSocketClient Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
stb
Earned a small fee
Earned a small fee
Posts: 22
Joined: Mon Aug 22, 2016 9:07 am

Strange behaviour with class wxSocketClient

Post by stb »

Hi!

Starting I think with the newest release 1803 of Win10, my program using class wxSocketClient no more works. I use version 3.0.4.
The behavior is very strange: When I start the compiled program from a network drive from a linux machine, it runs into an assert. If I copy it first to the local harddisk, it runs fine. I know this sounds silly...
I stripped it down to a simple program:

Code: Select all

#include "wx/wxprec.h"

#ifndef WX_PRECOMP
    #include "wx/wx.h"
#endif

#include <wx/app.h>
#include <wx/cmdline.h>
#include <wx/socket.h>


int main(int argc, char **argv)
{
        wxApp::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, "program");

        wxInitializer initializer;
        if(!initializer)
        {
                fprintf(stderr, "Failed to initialize the wxWidgets library, aborting.");
                return -1;
        }

        wxIPV4address addr;
        wxSocketClient *sock;

        addr.Hostname(wxT("192.168.200.218"));
        addr.Service(1000);

        sock=new wxSocketClient();
        sock->SetNotify(wxSOCKET_CONNECTION_FLAG|wxSOCKET_INPUT_FLAG|wxSOCKET_LOST_FLAG);
        sock->Notify(true);
        sock->SetFlags(wxSOCKET_WAITALL);
        sock->SetTimeout(1);
        sock->Connect(addr,false);
        sock->WaitOnConnect();

        wxPrintf("hello\n");

        return 0;
}
I appended a screenshot of the assert I get:
assert.jpg
assert.jpg (23.57 KiB) Viewed 971 times
has anyone an idea?

Thanks
Stephan
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Strange behaviour with class wxSocketClient

Post by PB »

Cursory google search revealed this, sounds very similar.
https://stackoverflow.com/questions/501 ... ng-from-ne
stb
Earned a small fee
Earned a small fee
Posts: 22
Joined: Mon Aug 22, 2016 9:07 am

Re: Strange behaviour with class wxSocketClient

Post by stb »

Thank you very much for this hint! - Yes, installing the Win10 update solves this issue.
Once more, I made the fault not coming up with the idea of finding the cause for a problem in windows itself...
Post Reply