Event and/or socket problems

Jonas Bengtsson jonas.b at gmail.com
Wed Jan 23 18:40:44 PST 2008


Hi all,

I'm trying to get to grips with sockets in wxwidgets. I have a few problems:

1) I don't get any events on incoming data or lost connection. I think =

I've set up everything as I should. The main thing that differs between =

my test application and the Socket sample seem to be that I don't have a =

wxWindow/wxFrame but instead create my own class that derives from =

wxEvtHandler. Perhaps I haven't set up the event handler correctly? Do I =

need to hook it up to something (besides the socket->SetEventHandler() =

call)?

2) My other problem is that if the server isn't running (i.e. I can't =

connect at the beginning) I can't connect to the server (I'm doing a =

while(!socket->WaitOnConnect(1)) loop).

Any ideas?

I've attached my test app, which should be self explanatory.

TIA,

Jonas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socketclient.cpp
Type: text/x-c++src
Size: 1678 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080124/e5=
de740d/socketclient.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socketclient.h
Type: text/x-chdr
Size: 483 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wx-users/attachments/20080124/e5=
de740d/socketclient.h


More information about the wx-users mailing list