Why does this trivial WebServer evocation hang Squeak?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Why does this trivial WebServer evocation hang Squeak?

LawsonEnglish
  The following code hangs Squeak. cmd-. doesn't break out of it. The
system window stays somewhat responsive but I can't interupt to see what
happened. I'm redirecting Second Life viewer login to localhost:8081 so
I can see what the current xmlrpc data sent by the SL viewer looks like.
SL viewer reports errors during login, but I managed to  inspect
"response" via cmd-i and it looks like there is a 2K buffer in the
WebResponse object. however, "response content inspect"  hangs Squeak:


response:= nil.
(WebServer reset default) listenOn: 8081.

WebServer default addService: '/' action:
[:req| response := req.
req send200Response: 'Hello World'
].

"Use Second Life viewer to attempt login at localhost:8081"


response content inspect.

Reply | Threaded
Open this post in threaded view
|

Re: Why does this trivial WebServer evocation hang Squeak?

LawsonEnglish
  response headers => an OrderedCollection('host'->'localhost:8081'
'accept'->'*/*' 'accept-encoding'->'deflate, gzip'
'content-type'->'text/xml' 'content-length'->'2105'
'expect'->'100-continue')

content => nil


So content is empty but inspecting it


On 10/7/10 2:18 AM, Lawson English wrote:

>  The following code hangs Squeak. cmd-. doesn't break out of it. The
> system window stays somewhat responsive but I can't interupt to see
> what happened. I'm redirecting Second Life viewer login to
> localhost:8081 so I can see what the current xmlrpc data sent by the
> SL viewer looks like. SL viewer reports errors during login, but I
> managed to  inspect "response" via cmd-i and it looks like there is a
> 2K buffer in the WebResponse object. however, "response content
> inspect"  hangs Squeak:
>
>
> response:= nil.
> (WebServer reset default) listenOn: 8081.
>
> WebServer default addService: '/' action:
> [:req| response := req.
> req send200Response: 'Hello World'
> ].
>
> "Use Second Life viewer to attempt login at localhost:8081"
>
>
> response content inspect.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Why does this trivial WebServer evocation hang Squeak?

LawsonEnglish
  So, I redid the code and finally got the right xml-rpc from the viewer.


+++++++++++++++++++
request= nil.

flag := false.
(WebServer reset default) listenOn: 8081.

WebServer default addService: '/' action:
[:req| |newResponse|  request := req.
     flag ifFalse:
     [newResponse := request newResponse  protocol: 'HTTP/1.1' code: 100.
     request sendResponse: newResponse content: 'Continue'.
     flag := true..
     ]
     ifTrue: [ req send200Response: 'Hello World' ]

].
++++++++++++++++++++++++++++++++++++++++++++

Now I'm stuck trying to use that myself. I keep getting invalid XML-RPC
errors back from teh SL server, even though I'm sending the entire
(hopefully valid) XML-RPC text that the viewer sent to the squeak WebServer.

No doubt some trivial thing I'm still doing wrong.

But at least its more nearly almost working than before.

;-)

Lawson