rpi.tcl help needed 
Author Message
 rpi.tcl help needed

Hi outthere,

I'm having some troble with the rpi.tcl package. One of the problems is
based
on the fact that I don't no how a client should behave we it is
finished.
A simple rpi::shutdown $client does not seem to be enough :-(. The
PeerList
is not corrected and is growing ...
I've include the listings of the client and the server, and in addition
a
trace of the server. Maybe someone has an idea ?

By the way, is someone out there using this package ?

    Greetings from Erding
        Peter

PS: I'm using tcl8.0 Patchlevel 2

------------------------------------------------------------------------

timeout 5000 Sock sock4 Port 40000 accessList 127.0.0.1:* PeerList
::rpi::I2cli
timeout 5000 Sock sock4 Port 40000 accessList 127.0.0.1:* PeerList
{::rpi::I2cli
 ::rpi::I3cli}
timeout 5000 Sock sock4 Port 40000 accessList 127.0.0.1:* PeerList
{::rpi::I2cli ::rpi::I3cli ::rpi::I4cli}
timeout 5000 Sock sock4 Port 40000 accessList 127.0.0.1:* PeerList
{::rpi::I2cli ::rpi::I3cli ::rpi::I4cli ::rpi::I5cli}
timeout 5000 Sock sock4 Port 40000 accessList 127.0.0.1:* PeerList
{::rpi::I2cli ::rpi::I3cli ::rpi::I4cli ::rpi::I5cli ::rpi::I6cli}
timeout 5000 Sock sock4 Port 40000 accessList 127.0.0.1:* PeerList
{::rpi::I2cli ::rpi::I3cli ::rpi::I4cli ::rpi::I5cli ::rpi::I6cli
::rpi::I7cli}
timeout 5000 Sock sock4 Port 40000 accessList 127.0.0.1:* PeerList
{::rpi::I2cli ::rpi::I3cli ::rpi::I4cli ::rpi::I5cli ::rpi::I6cli
::rpi::I7cli ::rpi::I8cli}

------------------------------------------------------------------------

#!/usr/local/bin/wish8.0
# Server
#
source log.tcl
source wait.tcl
source rpi.tcl

proc Hello {} {
    global s
    puts [rpi::iget $s]

    return "Hello brave World"

Quote:
}

::log::setup window "Server"

set s [rpi::newServer 40000]

vwait forever

------------------------------------------------------------------------

#!/usr/local/bin/tclsh8.0
# Client
#

source log.tcl
source wait.tcl
source rpi.tcl

set client [rpi::newClient 127.0.0.1 40000]

puts [rpi::invoke $client "Hello"]
rpi::shutdown $client

--
---------------------------------------------------------------------------
   Dr. Peter Stoehr --- Teisenbergweg 6 --- 85435 Erding --- 08122/47232
---------------------------------------------------------------------------



Fri, 11 Aug 2000 03:00:00 GMT  
 rpi.tcl help needed

Try adding

proc ::rpi::linkDown {this} {
    ILog "peer closed socket"
    delete $this

Quote:
}

to your server program
(after the package require rpi)

This will cause the delete method to be called
on the clients objects when the socket get closed
by the client and the "rpi::delete" method is the one
that actually get rid of the client object and handles
removing entries from the server object PeerList
(rpi::shutdown is just closing the tcl socket channel)

Because that seems a resonable indeed default behaviour,
I changed the default linkDown to do that.
I have put the 'fixed' version (rpi 1.1) on
http://www.demailly.com/~dl/rpi.tcl.txt

Thanks for the inputs


Quote:
> I'm having some troble with the rpi.tcl package. One of the problems is
> based
> on the fact that I don't no how a client should behave we it is
> finished.
> A simple rpi::shutdown $client does not seem to be enough :-(. The
> PeerList
> is not corrected and is growing ...
> I've include the listings of the client and the server, and in addition
> a
> trace of the server. Maybe someone has an idea ?
> By the way, is someone out there using this package ?

[...]

Yes, me ;-)
If more people are interested I would gladly maintain
it outside of the Plugin distribution.

--



Mon, 14 Aug 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Doc/examples for using the rpi,tck package

2. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

3. Subject: NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

4. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

5. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

6. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

7. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

8. ***HELP***HELP***NEED INFORMATION***HELP***HELP

9. MP3 player write by the TCL/TK (needs help)

10. New tcl user needs help

11. flashing widgets in tcl/tk8.3 - need help.

12. Need help fixing TCL script

 

 
Powered by phpBB® Forum Software