Menu

#2179 socket -server fails to run command in tclsh

obsolete: 8.3
closed-invalid
5
2003-02-06
2003-02-06
Anonymous
No

'socket -server command port' should set 'command' to
be run whenever a client attempts to connect to 'port',
but it does not. Specifically, I run the following in
tclsh8.3:

proc temp {channel address port} {
puts "channel $channel address $address port $port"
}
socket -server temp 2000

I then run the following in a second tclsh8.3:

socket myhost 2000

I expect to see the puts command's output appear in the
server's shell, but this does not happen.

I have run the same code successfully with the server
in a wish8.3 shell and in an expect shell, both using
the same local .rc file as tclsh does. The client's
shell seems to make no difference. The server also
failed in tclsh8.0.

I am running Debian linux 3.0 with kernel 2.4.18,
tcl8.3 version 8.3.3-7, and glibc 2.2.5-10.

Ashley Gadd
gadd@interchange.ubc.ca

Discussion

  • Donal K. Fellows

    • labels: 105659 --> 24. Channel Commands
    • assigned_to: dkf --> andreas_kupries
     
  • Don Porter

    Don Porter - 2003-02-06

    Logged In: YES
    user_id=80530

    Did you start an event loop?

    From the [socket] documentation:

    Server sockets depend on the Tcl event mechanism to find out
    when new connections are opened. If the application doesn't
    enter the event loop, for example by invoking the vwait
    command or calling the C procedure Tcl_DoOneEvent, then no
    connections will be accepted.

     
  • Don Porter

    Don Porter - 2003-02-06
    • assigned_to: andreas_kupries --> dgp
    • status: open --> closed-invalid