Shop OBEX P1 Docs P2 Docs Learn Events
my spinneret was locking up think i fixed — Parallax Forums

my spinneret was locking up think i fixed

zapmasterzapmaster Posts: 54
edited 2010-12-19 16:52 in Accessories
If i the web page is refreshed when a page was loading things would just lock up. I think this would lock if more then one person tried to get on my page at the same time.
the fix is i added
repeat
end '***ADDED TO STOP REFRESH LOCK UP***
'Waiting for a client to connect
PST.Str(string("Waiting for a client to connect....", PST#NL))
'Testing Socket 0's status register and looking for a client to connect to our server
repeat while !ETHERNET.SocketTCPestablished(0)
'Connection established
PST.Str(string("connection established..."))
'Initialize the buffers and bring the data over
bytefill(@data, 0, _bytebuffersize)
ETHERNET.rxTCP(0, @data)
if data[5] == "A" 'A = home page
home_page
if data[5] == "B" 'B = boiler page
boiler_page
if data[5] == "C" 'C = Solar page
Solar_page
if data[5] == "D" 'D = boiler fraim
boiler_fraim
if data[5] == "E" 'E = Solar fraim
Solar_fraim
if data[5] == "F" 'F = Boiler left fraim
Boiler_left_fraim
if data[5] == "H" 'G = Solar left fraim
Solar_left_fraim
if data[0] == "G"
home_page


pub end

PauseMSec(5)
'End the connection
ETHERNET.SocketTCPdisconnect(0)
PauseMSec(10)
'Connection terminated
ETHERNET.SocketClose(0)
PST.Str(string("Connection complete", PST#NL, PST#NL))
'Once the connection is closed, need to open socket again
OpenSocketAgain

Comments

  • Mike GMike G Posts: 2,702
    edited 2010-12-19 15:39
    Please use the code tags so your code is formatted properly as indentation is important in Spin.

    Looking at you code it appears that you never execute any of the if statements, just "pub end" over and over again.
  • zapmasterzapmaster Posts: 54
    edited 2010-12-19 16:50
    Mike G wrote: »
    Please use the code tags so your code is formatted properly as indentation is important in Spin.

    Looking at you code it appears that you never execute any of the if statements, just "pub end" over and over again.

    Yea i did not like how it looked what are code tags?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-12-19 16:52
    Put your code between these: [noparse]
    and
    
    [/noparse].

    -Phil
Sign In or Register to comment.