Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Server As ServerSocket
Private Clients As Map
Private uId As Int= 0
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
Server.Initialize(10733 , "Server")
Server.Listen
MainForm.Show
End Sub
Sub Server_NewConnection (Successful As Boolean, NewSocket As Socket)
If Successful Then
Dim client As AsyncStreams
client.Initialize(NewSocket.InputStream , NewSocket.OutputStream , "Client")
Clients.Put(uId , client) ' save current new connection to map
uId = uId + 1
Server.Listen ' Listen for next connection...
End If
End Sub
.
.
.