I want build a small UDP server that receive a packed from a port and redirect to another IP and port.
I' tryed this code, it receive but cannot redeirect.
what did i do wrong?
I' tryed this code, it receive but cannot redeirect.
what did i do wrong?
Redirect Service:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim socketReceive, socketSend As UDPSocket
End Sub
Sub Service_Create
socketReceive.Initialize("sockedReceive",9102,8000)
socketSend.Initialize("sockedSend",9101,8000)
End Sub
Sub Service_Start (StartingIntent As Intent)
Service.StopAutomaticForeground 'Call this when the background task completes (if there is one)
End Sub
Sub Service_Destroy
End Sub
Sub sockedReceive_PacketArrived (PacketFromSender As UDPPacket)
Log("Received from Sender")
'...this is he one that you are listening to
Dim InviaUDP As UDPPacket
InviaUDP.Initialize(PacketFromSender.data,"192.168.1.249",9101)
socketSend.Send(InviaUDP)
Sleep(1000)
End Sub
Sub sockedSend_PacketArrived (PacketFromReceiver As UDPPacket)
Log("Received from Receiver")
'...this is he on e that you are listening To
Dim InviaUDP As UDPPacket
InviaUDP.Initialize(PacketFromReceiver.data,"192.168.1.169",9102)
socketReceive.Send(InviaUDP)
End Sub
Last edited: