more info on wxSOCKET_IOERR

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
mael15
Super wx Problem Solver
Super wx Problem Solver
Posts: 403
Joined: Fri May 22, 2009 8:52 am
Location: Bremen, Germany

more info on wxSOCKET_IOERR

Post by mael15 » Fri Mar 20, 2020 2:53 pm

hi everyone,

I am getting unpredictable wxSOCKET_IOERR and struggle to get to the bottom of this. How can I get more information, i.e. was there a buffer problem? Which side of the TCP connection produced the error?
Another thing: to reduce problems I started securing socket access by different threads with wxMutex. This sometimes leads to a freeze when one thread is in wxSocketBase::WaitForRead() after locking the mutex and another thread tries to lock this mutex. So I was wondering: what kinds of socket access need to be secured by a mutex? maybe only Read and Write, not WaitForRead and LastReadCount? Or does reading and writing one socket have to be exclusive at all?

Basics: I communicate with a device via three threads on Windows: SettingsWriteThread, SettingsReadThread and DataThread using one socket for the settings and one for the data coming from the device.
Thanx!

Post Reply