wm withdraw .; wm withdraw .output; wm geom .konsola 631x424+379+288; #% # tclws jako serwer embeded # + byly bledy typu 8.4 vs 8.5 !!! # + okazuje sie ze "met" MUSI zwracac slownik {metResult wartosc} # + mozna uzywac "typ()" do def. sekwencji... (tak jak w tclsoap!) # + nie wiam jak tclws sie spisuje pod tclhttpd, aolser, ... # lappend auto_path ~/tcl/tcllib ~/tcl package re WS::Server #% 2.3.7 package re WS::Embeded #% 2.3.0 ::WS::Server::Service -mode embedded -service qqq -ports 5000 #% # ... ::WS::Server::ServiceProc qqq {met1 {type string comment {typ ret}}} { par1 {type string comment {typ par1}} par2 {type int comment {typ par2}} } {???} { return [list met1Result "a ku ku !!! par1=$par1, par2+1=[expr {$par2+1}]"] # + wynik koniecznie musi byc takim slownikiem ?!?!?! } # + mozna wielokrotnie przedefiniowywac te operacje... # ... WS::Utils::ServiceTypeDef Server qqq mojTyp { a {type string} b {type int} } ::WS::Server::ServiceProc qqq {met2 {type mojTyp()}} { liczbaElem {type int} } {???} { #set w {{a "qqq" b 111} {a "www" b 222}} set w {} for {set i 0} {$i<$liczbaElem} {incr i} { lappend w [list a "qqq$i" b $i] } return [list met2Result $w] } # ... ::WS::Server::ServiceProc qqq {met3 {type int}} { p1 {type int} p2 {type int} } {???} { return [list met3Result [expr {$p1+$p2}]] } if 0 { ::WS::Server::ServiceProc qqq {met3 {type int}} { } {???} { return [list met3Result [expr {123}]] } } # ... ::WS::Server::ServiceProc qqq { razyDwa {type int() comment {zwraca ciąg przemnożonych liczb...}} } { par1 {type int() comment {ciag liczb int}} } {mnozy elementy ciagu razy 2} { set w {} foreach e $par1 {lappend w [expr {$e*2}]} return [list razyDwaResult $w] } # ... #% ::WS::Embeded::Listen 5000 #% sock5 file chan sock* #% sock5