Sub StartAstream(s As Socket)
astreamO.Start(s.InputStream, s.OutputStream)
Log("startAstream")
Log(ipxx)
indec.SetAlphaAnimated(1000,0)
label1.SetAlphaAnimated(1000,0)
Panel3.SetAlphaAnimated(1000,0)
Panel4.SetAlphaAnimated(1000,0)
End Sub
Sub AstreamO_Terminated
Log("teminated")
Log(ipxx)
server.Listen
client.Close
client.Initialize("client")
indec.SetAlphaAnimated(1000,1)
label1.SetAlphaAnimated(1000,1)
Panel3.SetAlphaAnimated(1000,1)
Panel4.SetAlphaAnimated(1000,0.6)
End Sub
Sub client_Connected (Successful As Boolean)
If Successful Then
StartAstream(client)
indec.SetAlphaAnimated(1000,0)
label1.SetAlphaAnimated(1000,0)
Panel3.SetAlphaAnimated(1000,0)
Panel4.SetAlphaAnimated(1000,0)
Main.hd.ProgressDialogHide
Main.hd.ToastMessageShow("Connected!",False)
Else
'Main.hd.ToastMessageShow("Error: " & LastException, True)
Log(ipxx)
indec.SetAlphaAnimated(1000,1)
label1.SetAlphaAnimated(1000,1)
Panel3.SetAlphaAnimated(1000,1)
Panel4.SetAlphaAnimated(1000,0.6)
Main.hd.ProgressDialogHide
Main.hd.ToastMessageShow("Failed to connect",False)
End If
End Sub
Sub Server_NewConnection (Successful As Boolean, NewSocket As Socket)
If Successful Then
StartAstream(NewSocket)
Log("newConnection")
stopx="y"
Log(ipxx)
indec.SetAlphaAnimated(1000,0)
label1.SetAlphaAnimated(1000,0)
Panel3.SetAlphaAnimated(1000,0)
Panel4.SetAlphaAnimated(1000,0)
'Panel3.SetAlphaAnimated(1000,0)
Else
indec.SetAlphaAnimated(1000,1)
label1.SetAlphaAnimated(1000,1)
Panel3.SetAlphaAnimated(1000,1)
Panel4.SetAlphaAnimated(1000,1)
' Panel3.SetAlphaAnimated(1000,1)
End If
End Sub
Sub astreamO_ObjectSent (Key As String)
Log("Object sent: " & Key)
indec.SetAlphaAnimated(1000,0)
label1.SetAlphaAnimated(1000,0)
End Sub
Sub astreamO_NewObject(Key As String, Value As Object)
Select Key
Case "form"
Case "simple value"
Case "image"
Case "file"
indec.SetAlphaAnimated(1000,0)
label1.SetAlphaAnimated(1000,0)
LIV2.StartAnimating
Dim fileName As String = Value
Log("Received file. File size: " & File.Size(astreamO.TempFolder, fileName))
mp.Initialize(astreamO.TempFolder,fileName,"mp")
mp.Play
End Select
End Sub