how to use TCP in wx to non-wx?

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
ghjmaui
Earned a small fee
Earned a small fee
Posts: 11
Joined: Fri Nov 02, 2012 1:40 am

how to use TCP in wx to non-wx?

Post by ghjmaui » Mon Aug 19, 2013 9:18 pm

Hello-
I could find nothing in the forum about this, and I hope I am not repeating another topic entry. I would like to connect over IP to an application on another machine from my MSW wxWidgets GUI, but the application on the other machine is not running any sort of wxWidgets application (it is an Arduino). I would like to use TCP, since I need to send data back and forth, but it appears that wx only supports DDE-like communication, and the server on the other end needs to be running a wxTCPServer for my wxTCPClient to connect to. Arduino supports TCP, but knows nothing about wx. Is there a way to do this? I could try using a wxDatagramSocket and send UDP packets, and then spin off a thread to read UDP packets coming from the Arduino, but it would be nice to use a TCP connection instead, since I can definitively open and close the TCP link and both sides know the other exists. There appears to be no way to send generic commands or get generic responses via TCP inside wx, apart from the DDE paradigm. Thanks.

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: how to use TCP in wx to non-wx?

Post by eranon » Mon Aug 19, 2013 9:29 pm

Don't know, but maybe this thread (and digging in CodeBlocks source) could help you or give you some ideas : http://forums.codeblocks.org/index.php?topic=2757.0
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

User avatar
bishop.gis
Earned a small fee
Earned a small fee
Posts: 20
Joined: Fri May 25, 2012 6:47 pm

Re: how to use TCP in wx to non-wx?

Post by bishop.gis » Tue Aug 20, 2013 7:48 am

Use wxSocket read and write functions:
http://docs.wxwidgets.org/2.9.5/classwx ... _base.html

Post Reply