more info on wxSOCKET_IOERR
Posted: 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!
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!