Tk Library Source Code

View Ticket
Login
Ticket UUID: 1198361
Title: comm calls bgerror in synchronous call and no event loop
Type: Bug Version: None
Submitter: bschofield Created on: 2005-05-09 15:33:38
Subsystem: comm Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2006-01-24 10:20:19
Resolution: None Closed By: sf-robot
    Closed on: 2006-01-24 03:20:19
Description:
If "comm send" has any error, it calls ::bgerror which
is undesirable in some cases. Consider the following
program

# start
package require comm
set s [comm::comm]
comm::comm send $s {set x y z}
# end

This calls ::bgerror. However, there is no *background*
error. This is just a plain error. Should the call be
asynchronous in nature, then a background error would
be appropriate.

Suggested fix:

In proc ::comm::commExec at the bottom, just before
return, change the line
    if {$err ==1} {
         commBgerror $ret
    }

to
   if {$err ==1 && ![string equal send $cmd]} {
        commBgerror $ret
   }


Here is some additional test code:
# start
package require comm
package require Tk
set s [comm::comm self]
after 1000 [list comm::comm send $s {set x y z}]
# a bgerror will be thrown
User Comments: sf-robot added on 2006-01-24 10:20:19:
Logged In: YES 
user_id=1312539

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).

andreas_kupries added on 2006-01-10 04:28:27:
Logged In: YES 
user_id=75003

To the submitter: Is this still current and relevant ?

andreas_kupries added on 2005-05-10 00:44:45:
Logged In: YES 
user_id=75003

In your example, are transmitter and receiver of the
commands in the same process ? Have you tried this across
different processes ?

I am trying to understand the exact nature of the problem,
and the examples given are a bit short.

For example I do not see described where any of the errors
is reported, in the client, or in the server process ? That
does make a difference for the sync and async calls.

Note also that 'after 1000 comm::send' is not async call. It
is delayed invoked in the client, but the communication is sync.

Async communication is 'comm::send -async {...}'.