B4J Question [ Jnetwork ] udp sockets Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-0" AND in thread "main"

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
hello everyone, I currently created a udp client to send messages at all times to the b4j udp server, I can read all the messages that are being sent by the clients, but a few seconds later I receive these messages in the b4j console:

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-0"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

B4X:
51018
[B]... [/B]

51018
Mensagem Recebida  > An hello from a client [ 409 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
51018
Mensagem Recebida  > An hello from a client [ 409 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
51018
Mensagem Recebida  > An hello from a client [ 409 ]
-------------------------------------------------------------
51018
Mensagem Recebida  > An hello from a client [ 409 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
51018
Mensagem Recebida  > An hello from a client [ 409 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
51018
Mensagem Recebida  > An hello from a client [ 409 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
63208
Mensagem Recebida  > An hello from a client [ 123 ]
-------------------------------------------------------------
51018
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-0"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"


I'm using this source code >
B4X:
'Non-UI application (console / server application)
#Region Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
#End Region

Sub Process_Globals
   
    Private udp As UDPSocket
   
End Sub

Sub AppStart (Args() As String)
    Log("starts udp listener")
   
    udp.Initialize("udp",6832,8192)
   
    StartMessageLoop
   
End Sub

Sub udp_PacketArrived (Packet As UDPPacket)
   
    Log($"${Packet.Port}"$)
    Try
        Dim s As String
        s = BytesToString(Packet.Data, 0, Packet.Length, "UTF-8")
        Log("Mensagem Recebida  > "&s)
        Log("-------------------------------------------------------------")
    Catch
        Log(LastException)
    End Try
   
End Sub

I'm using this client to send messages (it's an .exe)
c++ client

virus total : https://www.virustotal.com/gui/url/...bb9b1909784fc2bbe7dcadce7f3d2e8b30c?nocache=1
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…