I am running a simple example of a WebSocket server.
When I compile, I receive the following error:
My B4J Code (Main):
My B4J Code (WebSocket class):
I am running Windows Server 2008 R2.
I cannot find any other instance of result.jar that is running.
When I compile, I receive the following error:
B4X:
B4J version: 4.50
Parsing code. (0.00s)
Compiling code. Error
The process cannot access the file 'C:\B4A-WebSocket\Objects\result.jar' because it is being used by another process.
B4X:
'Non-UI application (console / server application)
#Region Project Attributes
#CommandLineArgs:
#MergeLibraries: True
#End Region
Sub Process_Globals
Public srvr As Server
End Sub
Sub AppStart (Args() As String)
srvr.Initialize("")
srvr.Port = 32009
srvr.AddWebSocket("/ws", "B4A")
srvr.Start
StartMessageLoop
End Sub
My B4J Code (WebSocket class):
B4X:
Sub Class_Globals
Private ws As WebSocket
Private timer1 As Timer
End Sub
Public Sub Initialize
End Sub
Private Sub WebSocket_Connected (WebSocket1 As WebSocket)
ws = WebSocket1
timer1.Initialize("timer1", 1000)
timer1.Enabled = True
End Sub
Sub Timer1_Tick
ws.RunFunction("ServerTime", Array As Object(DateTime.Time(DateTime.Now)))
ws.Flush
End Sub
Sub Device_Message(Params As Map)
Log("Device message: " & Params.Get("message"))
End Sub
Private Sub WebSocket_Disconnected
timer1.Enabled = False
Log("disconnected")
End Sub
I am running Windows Server 2008 R2.
I cannot find any other instance of result.jar that is running.