[ wxwindows-Patches-1833150 ] wxIPC with wxConsoleEventLoop
SourceForge.net
noreply at sourceforge.net
Sun Feb 3 16:01:17 PST 2008
Patches item #1833150, was opened at 2007-11-16 15:10
Message generated for change (Comment added) made by vadz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1833150&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Socket
Group: new feature
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Anders Larsen (alarsen)
Assigned to: Vadim Zeitlin (vadz)
Summary: wxIPC with wxConsoleEventLoop
Initial Comment:
The attached patch fixes a problem with GSocket::Select which prevented wxSocket from working correctly when option wxSOCKET_WAITALL is set.
As an (unrelated) improvement, always set wxSOCKET_REUSEADDR (allowing an IPC server to be stopped and restarted in rapid succession).
To demonstrate the fix, two samples are included (samples/ipc/baseipc{client,server}
This patch requires patch #1756260 from Lukasz Michalski
----------------------------------------------------------------------
>Comment By: Vadim Zeitlin (vadz)
Date: 2008-02-04 01:01
Message:
Logged In: YES
user_id=71618
Originator: NO
Applied, thanks again for fixing this!
I'm still more or less sure that this code must be rewritten (we shouldn't
use polling at all...) but at least the next time I try to do it I will
have a test which I can use to verify if my changes actually work, thanks
for contributing it!
----------------------------------------------------------------------
Comment By: Anders Larsen (alarsen)
Date: 2008-01-21 18:21
Message:
Logged In: YES
user_id=158901
Originator: YES
File Added: baseipc.patch
----------------------------------------------------------------------
Comment By: Anders Larsen (alarsen)
Date: 2008-01-21 18:19
Message:
Logged In: YES
user_id=158901
Originator: YES
GSocket::Select() does nothing but poll for the specified event bits in
m_detected;
however, they aren't being set anywhere (in particular GSOCK_INPUT_FLAG),
and so
wxSocketBase::WaitForRead() will busy-wait forever (see attached trace
ipcserver.png)
The attached patch (against rev 51299) reinstantiates the old body of
GSocket::Select.
Since the busy-wait took place inside an event handler, there's no easy
way (that I
can see) to have event-handlers set the flags in m_detected.
With the patch applied, the IPC samples work again (tested on Linux/GTK);
the two
primitive samples/ipc/baseipc{client,server} demonstrate that (TCP-based)
IPC now
works with baseevtloop, too.
File Added: ipcserver.png
----------------------------------------------------------------------
Comment By: SourceForge Robot (sf-robot)
Date: 2008-01-21 04:20
Message:
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2008-01-06 16:15
Message:
Logged In: YES
user_id=71618
Originator: NO
This patch doesn't apply any more as the result of the change I mentioned
so I'm changing its state for now. Something is almost surely broken
here...
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2007-12-20 02:26
Message:
Logged In: YES
user_id=71618
Originator: NO
I've removed the entire "if ( !CanUseEventLoop() )" part of select()
because after analysing the code I thought that this branch was never used
any more (in fact I also removed CanUseEventLoop() too as it seemed to
always return true anyhow). What did I miss?
----------------------------------------------------------------------
Comment By: Anders Larsen (alarsen)
Date: 2007-12-15 19:56
Message:
Logged In: YES
user_id=158901
Originator: YES
Patch refreshed against svn rev. 50721
File Added: baseipc.patch
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1833150&group_id=9863
More information about the wx-dev
mailing list