B4R Question aStream Stack problem? [probably not solvable...]

Hans- Joachim Krahe

Active Member
Licensed User
Longtime User
... this works fine, without...

B4X:
Private Sub Server_NewConnection (NewSocket As WiFiSocket)
    Astream.Initialize(NewSocket.Stream, "astream_NewData", "astream_Error")
    Astream.WaitForMoreDataDelay = 100
End Sub

Private Sub Astream_NewData (Buffer() As Byte)
    Log("")
    Log("-------------new income buffer: ",Buffer)
    Log(" stack: ",StackBufferUsage)
 
    If bc.IndexOf(Buffer, "GET") <> -1 Then

        Public wB() As Byte = "<!DOCTYPE html PUBLIC @-//W3C//DTD XHTML 1.0 Transitional//EN@ @http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd@>"      
        astreamOut(wB)
        Public wB() As Byte = "<html xmlns=@http://www.w3.org/1999/xhtml@>"
        astreamOut(wB)
        Public wB() As Byte ="<head>"
        astreamOut(wB)
        Public wB() As Byte = "<meta content=@de@ http-equiv=@Content-Language@ />"
        astreamOut(wB)
        Public wB() As Byte ="<meta content=@de@ http-equiv=@Content-Language@ />"
        astreamOut(wB)
        Public wB() As Byte ="<meta content=@text/html; charset=utf-8@ http-equiv=@Content-Type@ />"
        astreamOut(wB)
        Public wB() As Byte ="<title>Ohne_Titel_1</title>"
        astreamOut(wB)
        Public wB() As Byte ="<style Type=@text/css@>"
        astreamOut(wB)
        Public wB() As Byte =".style1 {"
        astreamOut(wB)
        Public wB() As Byte ="margin-left: 80px;"
        astreamOut(wB)
        Public wB() As Byte ="}"
        astreamOut(wB)
        Public wB() As Byte ="</style>"
        astreamOut(wB)
        Public wB() As Byte ="</head>"
        astreamOut(wB)
        Public wB() As Byte ="<body>"
        astreamOut(wB)
        Public wB() As Byte ="<form action=@@ form method=@post@>"
        astreamOut(wB)
        Public wB() As Byte ="Name<input class=@style1@ name=@T1@ Type=@text@ value=@bla1@ /><br /><br />"
        astreamOut(wB)
        Public wB() As Byte ="Max <input class=@style1@ name=@T2@ Type=@text@ value=@bla22222@ /><br /><br />" : astreamOut(wB)
        Public wB() As Byte ="<input name=@T3@ Type=@text@ class=@style1@ value=@bla3@ /><br /><br />"
        astreamOut(wB)
        Public wB() As Byte ="Dauer<input class=@style1@ name=@T4@ Type=@text@ value=@bla4@ /><br /><br />"
        astreamOut(wB)
        Public wB() As Byte ="<button type=@submit@ formmethod=@post@>Submit using POST</button>"            '"<button class=@btn btn-lg btn-primary btn-block@ type=@submit@>Reset</button>"                        ' "<button name=@foo@ value=@upvote@>Upvote</button>@ /><br />"
        astreamOut(wB)
        Public wB() As Byte ="<button class=@btn btn-lg btn-primary btn-block@ type=@submit@>Reset</button>"                        ' "<button name=@foo@ value=@upvote@>Upvote</button>@ /><br />"
        astreamOut(wB)
        Public wB() As Byte = "<button name=@foo@ value=@upvote@>Upvote</button><br />"
        astreamOut(wB)
        Public wB() As Byte ="</form>"
        astreamOut(wB)
        Public wB() As Byte ="</body>"
        astreamOut(wB)
        Public wB() As Byte ="</html>"
        astreamOut(wB)
        CallSubPlus("CloseConnection", 200, 0)
    End If


incoming message (DNT: 1) is interrupted after 108 Byte, never mind I change text or set Astream.WaitForMoreDataDelay = 100


Ican fix it by string manipulation, but why does'nt it work correct? Stack is much bigger...



thanks^


... additional: stack buffer = 2000, astream stops at 108 Byte...


..ok, problem seems to be structural - saw thread from 2016...
 
Last edited:

Mostez

Well-Known Member
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…