Check-in [1610455cee]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed outdated example EchoEmbeddedService. Ticket [0e2728fadd]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1610455cee0b54484d8aae5e871aafbf275fb737
User & Date: oehhar 2015-11-03 17:42:07
References
2015-11-03 17:44 Fixed ticket [0e2728fadd]: File Examples/Echo/EchoEmbeddedService.tcl outdated: uses old proc "ws::embeded::start" plus 3 other changes artifact: af7408648d user: oehhar
Context
2015-11-09 16:17
::WS::Utils::geturl_followRedirects : limit to 5 redirects, plug http package memory leak, add redirect test scripts check-in: a18130bfaf user: oehhar tags: trunk
2015-11-03 17:42
Fixed outdated example EchoEmbeddedService. Ticket [0e2728fadd] check-in: 1610455cee user: oehhar tags: trunk
2015-06-16 17:05
Return http error messages for authentication and server errorrs. Ticket [ea054d339d] check-in: 3647d0b69f user: oehhar tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Examples/Echo/EchoEmbeddedService.tcl.

29
30
31
32
33
34
35

36
37
38
39
40
41
42
43
44
45
..
79
80
81
82
83
84
85
86
87
88
89
90
91


92
93

##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       ##
##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING IN       ##
##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  ADVISED OF THE         ##
##  POSSIBILITY OF SUCH DAMAGE.                                              ##
##                                                                           ##
###############################################################################


package require WS::Server 2.3.0
package require WS::Utils 2.3.0
package require WS::Embeded 2.3.0

##
## Define the service
##
::WS::Server::Service \
    -service wsEchoExample \
    -description  {Echo Example - Tcl Web Services} \
................................................................................
    {Echo a string and a timestamp back} {

    set timeStamp [clock format [clock seconds] -format {%Y-%m-%dT%H:%M:%SZ} -gmt yes]
    return [list ComplexEchoResult [list echoBack $TestString echoTS $timeStamp]  ]
}

set ::errorInfo {}
::WS::Embeded::Listen 8015
set ::errorInfo {}

puts stdout {Starting event loop}
flush stdout
::WS::Embeded::Start


puts stdout {Exited event loop}
flush stdout







>
|
|
|







 







|


|

|
>
>


>
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
..
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
##  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT       ##
##  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR  OTHERWISE) ARISING IN       ##
##  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF  ADVISED OF THE         ##
##  POSSIBILITY OF SUCH DAMAGE.                                              ##
##                                                                           ##
###############################################################################

lappend auto_path [file join [file dirname [info script]] ../..]
package require WS::Server
package require WS::Utils
package require WS::Embeded

##
## Define the service
##
::WS::Server::Service \
    -service wsEchoExample \
    -description  {Echo Example - Tcl Web Services} \
................................................................................
    {Echo a string and a timestamp back} {

    set timeStamp [clock format [clock seconds] -format {%Y-%m-%dT%H:%M:%SZ} -gmt yes]
    return [list ComplexEchoResult [list echoBack $TestString echoTS $timeStamp]  ]
}

set ::errorInfo {}
set SocketHandle [::WS::Embeded::Listen 8015]
set ::errorInfo {}

puts stdout {Server started. Press Enter to stop}
flush stdout
fileevent stdin readable {set QuitNow 1}
vwait QuitNow
close $SocketHandle
puts stdout {Exited event loop}
flush stdout