Tk Library Source Code

View Ticket
Login
Ticket UUID: 1861565
Title: comm: error msg not clear when server port is in use
Type: Bug Version: None
Submitter: hemanglavana Created on: 2007-12-31 23:57:46
Subsystem: comm Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2008-03-01 03:22:53
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2008-02-29 20:22:53
Description:
Hi,

I am trying to create a comm channel on a specific port so that client knows which port to connect to. However, when the server port is already in use, the comm package doesn't throw an appropriate error message, see below:

# First, start a server on port 5050 and then run
# the following:
mavis:49> tclsh
% socket -server _acceptConnection 5050
couldn't open socket: address already in use
% package require comm
4.5.6
% comm::comm new xxx -port 5050 -local 0 -listen 1
can't delete "::xxx": command doesn't exist
%  comm::comm new xxx -port 5051 -local 0 -listen 1
::xxx
% exit
mavis:50>

As you can see, tcl's socket command clearly indicates where the problem is whereas the error message from comm pkg is misleading.

Hemang.
User Comments: andreas_kupries added on 2008-03-01 03:22:53:
Logged In: YES 
user_id=75003
Originator: NO

Patch accepted and applied to head. comm version bumped to 4.5.7.

hemanglavana added on 2008-01-02 12:05:14:

File Added - 260432: patch.diffs

Logged In: YES 
user_id=81875
Originator: YES

I am attaching a patch and a tcltest to fix this issue.
File Added: patch.diffs

Attachments: