Page 1 of 1

more info on wxSOCKET_IOERR

Posted: Fri Mar 20, 2020 2:53 pm
by mael15
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!

Re: more info on wxSOCKET_IOERR

Posted: Fri Apr 03, 2020 1:37 pm
by mael15
hmmmm, seems to be as tricky as it appears?

Re: more info on wxSOCKET_IOERR

Posted: Fri Apr 03, 2020 3:28 pm
by doublemax
I don't know much about sockets, my feeling tells me that separate threads for reading and writing should work without a mutex. But i also think one thread per socket would be nicer ;)

Try asking on the wx-users group where you can reach the core wx devs:
https://groups.google.com/forum/#!forum/wx-users