Cheesy Disclaimer: I've been using wxWidgets for only a few days now, so I'm still getting familiar with the components.
I am trying to develop a system where several applications communicate with each other over a central data exchange. I want to use wxServer as the exchange and have a bunch of wxClient objects in my applications. The clients can both send and recieve information of various types by sending it to the server. I want to do this asychronously, so my clients may not be ready for data when they recieve it.
I have a couple of issues:
First, is their any way to avoid the errors caused when a client is executing one "Connection::OnAdvise()" call and another Advise() is performed by the server? Same for other methods, like Poke(). I notice that they all time out really fast.
Second, I want my final product to use TCP/IP, not DDE. I know that to do this you need to use
#define wxUSE_DDE_FOR_IPC 0
However, when I do this, my initial connection is never even made. Are there other settings, or has anyone else had issues like this before? I am using Windows XP SP2, if that could be somehow blocking. Firewall is off (of course).
I'd appreciate any advice.
wxServer/Client issues
-
- In need of some credit
- Posts: 7
- Joined: Thu Aug 18, 2005 8:29 pm
wxServer/Client issues
Last edited by Veni_Vidi_Exi on Thu Aug 18, 2005 8:56 pm, edited 1 time in total.
- I came, I saw, I left.
-
- In need of some credit
- Posts: 7
- Joined: Thu Aug 18, 2005 8:29 pm
Hmmm, I didn't notice some of the extra functionality of SocketBase. But the docs say you shouldn't create one directly? Ah, I'll try it.
Still, though, TCP/IP should get through. Has anyone running XP out there had issues with it? I set the flag for DDE and everything is fine, but set it for TCP and no connections are ever made.
Still, though, TCP/IP should get through. Has anyone running XP out there had issues with it? I set the flag for DDE and everything is fine, but set it for TCP and no connections are ever made.
- I came, I saw, I left.
The docs are right on this, you shouldn't create a wxSocketBase yourself. Use wxSocketServer and wxSocketClient instead. But, using wxSocketServer::Accept() you'll get a wxSocketBase instance, representing the client endpoint.Veni_Vidi_Exi wrote:Hmmm, I didn't notice some of the extra functionality of SocketBase. But the docs say you shouldn't create one directly? Ah, I'll try it.
Still, though, TCP/IP should get through. Has anyone running XP out there had issues with it? I set the flag for DDE and everything is fine, but set it for TCP and no connections are ever made.
Although I strongly suggest using the socket classes, here's one thing you could try:
Use wxTCPServer and wxTCPClient directly instead of letting wxWidgets choose which one to take by using wxServer and wxClient. You may have to include wx/sckipc.h for that.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
-
- Super wx Problem Solver
- Posts: 424
- Joined: Tue Jul 12, 2005 8:44 pm
- Location: Alabama, USA
I just wanted to say that I've had issues using TCP with the IPC classes on XP. I have an application that uses DDE for IPC, and everything works as expected. If I set
the initial connection appears to be made from the client side, but it hangs using 100% of the CPU as soon as it tries to write to the socket stream. I haven't had time to debug this and only a Windows version of my application is required at the moment. However, it would be good to determine why there are issues using TCP with the IPC classes under Windows.
-Scott
Code: Select all
#define wxUSE_DDE_FOR_IPC 0
-Scott
I have to say that after playing with wxWidgets DDE client/server connections that I believe in general they appear to be very buggy. I have found both the TCP and DDE implementations to be broken - which suggests that the bug must be is some base class. I have written a TCP/IP version of my app using just regular sockets and both the Windows and Linix versions appear to work perfectly. However if I use wxWidgets DDE (either DDE or TCP/IP) I have severe issues.
When using the wxWidgets DDE version I notice the following issues:
Windows:
Random OpenGL errors
Linux
Random OpenGL errors, followed by (at some random point in time) 100% CPU usage. It should be noted this 100% CPU usage only occurs if a message is being processed while I am resizing/mousing over the window.
I originally built off of the WxWidgets IPC sample project. At first I thought it was because logging was occuring outside the GUI thread. I removed all GUI logging and still have the same behavoir.
I believe that there is memory corruption that is taking place - however finding where can be elusive.
When using the wxWidgets DDE version I notice the following issues:
Windows:
Random OpenGL errors
Linux
Random OpenGL errors, followed by (at some random point in time) 100% CPU usage. It should be noted this 100% CPU usage only occurs if a message is being processed while I am resizing/mousing over the window.
I originally built off of the WxWidgets IPC sample project. At first I thought it was because logging was occuring outside the GUI thread. I removed all GUI logging and still have the same behavoir.
I believe that there is memory corruption that is taking place - however finding where can be elusive.
toxicBunny wrote:I just wanted to say that I've had issues using TCP with the IPC classes on XP. I have an application that uses DDE for IPC, and everything works as expected. If I set
the initial connection appears to be made from the client side, but it hangs using 100% of the CPU as soon as it tries to write to the socket stream. I haven't had time to debug this and only a Windows version of my application is required at the moment. However, it would be good to determine why there are issues using TCP with the IPC classes under Windows.Code: Select all
#define wxUSE_DDE_FOR_IPC 0
-Scott
same problem
I have the same problem with my code. my os is windows xp. the problem only occurs when I try to use tcp implementation of dde. one thing though, if i manually start the client via a button (event call), it connects to the server fine but if i try to initialize the client automatically in a frame constructor or the application oninit call, the program hangs (cpu 100%). I'll probably end up using wxTCPServer but it would be nice if someone can verify this possible bug.