Skip to content
Tcl Source Code History Of Ticket 217885
Login

History Of Ticket 217885

Artifacts Associated With Ticket 217885

  1. Ticket change [7ebf8613d4] (rid 97467) by nobody on 2000-10-26 00:45:23:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 2322 Bug
      Version: 8.1.1
      SubmitDate: '1999-07-06'
      LastModified: '1999-08-05'
      Severity: CRIT
      Status: Closed
      Submitter: techsupp
      ChangedBy: hobbs
      RelatedBugIDs: 2328
      OS: Windows 95
      Machine: X86
      FixedDate: '2000-10-25'
      ClosedDate: '1999-08-05'
      
      
      Name:
      Martin Conrad
      
      CustomShell:
      no
      
      ReproducibleScript:
      I developed 2 scripts. One implements a command server, one a client.
          The server offers a command shell to the client, running on the server.
          The command shell is command (Win 95), cmd (Win NT) or sh (Unix/Linux).
          
          Whenever at least one connection from a client has been established, the
          server can't be stopped. This is true after legal disconnect (see the
          server script), as <Cntrl-C> doesn't work. In that case, you can only
          use the task manager to stop the application, but shutdown hangs.
          
          To start the scripts, you need two command windows. In one, type
          
          tclsh81 cmdserver.tc 4711
          
          In the other, type
          
          tclsh81 cmdclient.tc name 4711
          
          where "name" is the host name (e.g."localhost", if you test on one
          computer). 4711 is the port number, you can use any free port number,
          4711 is only one example.
          
          On the client, you can type in a command, "exit" to finish the
          communication.
          
          Here the two scripts:
          
          ----------------------------------------------------- CmdServer.tc:
          
          #! /usr/local/bin/tclsh
          
          if {$argc != 1} {
          puts {Syntax: cmdserver port}
          exit
          }
          if [catch {expr [lindex $argv 0] + 0} port] {
          puts {Syntax: cmdserver port}
          exit
          }
          puts "cmdserver 0.1"
          
          proc service {fdx host port} {
          global X SH tcl_platform fds fd1 Y
          
          set fds $fdx
          puts "Connect from $host:$port"
          fconfigure $fds -blocking 0 -buffering none -translation {auto lf}
          if {[string compare "$tcl_platform(platform)" "windows"] == 0} {
          set fd1 [open "| cmd" r+]
          } else {
          set fd1 [open {| sh -c "exec sh -i 2>&1"} r+]
          }
          fconfigure $fd1 -blocking 0 -buffering none -translation {auto auto}
          fileevent $fd1 readable {
          set xxx [read $fd1 100]
          puts -nonewline $fds $xxx
          if [eof $fd1] {
          fileevent $fds readable {}
          fileevent $fd1 readable {}
          set Y 1
          }
          }
          fileevent $fds readable {
          set yyy [read $fds 100]
          puts -nonewline $fd1 $yyy
          if [eof $fds] {
          fileevent $fds readable {}
          fileevent $fd1 readable {}
          set Y 2
          }
          }
          vwait Y
          if {$Y == 1} {
          puts "Disconnecting $host:$port"
          } else {
          puts "Disconnect from $host:$port"
          }
          catch {close $fd1}
          close $fds
          }
          # setup global variables used from service proc
          set fds 0
          set fd1 1
          set Y   0
          set X 1
          set fd [socket -server service [lindex $argv 0]]
          vwait X
          
          ----------------------------------------------------- CmdClient.tc:
          
          #! /usr/local/bin/tclsh
          
          if {$argc != 2} {
          puts {Syntax: cmdclient host port}
          exit
          }
          if [catch {expr [lindex $argv 1] + 0} port] {
          puts {Syntax: cmdclient host port [cr|lf|crlf]}
          exit
          }
          puts "cmdclient 0.1"
          set fd [socket [lindex $argv 0] [lindex $argv 1]]
          fconfigure $fd -blocking 0 -buffering none -translation {binary binary}
          fconfigure stdin -blocking 0 -buffering none -translation auto
          fconfigure stdout -blocking 0 -buffering none -translation crlf
          fileevent $fd readable {
          set yyy [read $fd 100]
          puts -nonewline $yyy
          if [eof $fd] {
          puts "Connection lost"
          exit
          }
          }
          fileevent stdin readable {
          set xxx [read stdin 100]
          puts -nonewline $fd $xxx
          if [eof stdin] {
          exit
          }
          }
          set FOREVER 0
          vwait FOREVER
          
          ----------------------------------------------------- 
          
          Best regards,
          
          Martin
      
      ObservedBehavior:
      It isn't possible to stop the server script: <Cntrl-C> doesn't work.
          Shutdown is hanging.
      
      DesiredBehavior:
      <Cntrl-C> should stop the server script. As bad alternative, it would be
          acceptable, that the task manager must be used to kill the application.
          The shutdown must not hang.
      
      
      
      
      
    4. foundin initialized to: "final: 8.1.1"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to:
      Tcl error with socket / pine combination under Win 95
      
    11. type initialized to: "Bug"
  2. Ticket change [318f1b2e67] (rid 93445) by welch on 2000-10-26 08:09:10:

    1. closedate changed to: "2000-10-26T01:09:10"
    2. closer changed to: "welch"
    3. priority changed to: "3 Low"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [6c7039099e] (rid 128510) by dgp on 2001-04-21 08:14:40:

    1. closedate changed to: "2001-04-21T01:14:40"
    2. closer changed to: "dgp"
    3. subsystem changed to: "02. Event Loops"