#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 As UDPSocket
Dim socketSend As UDPSocket
End Sub
Sub Service_Create
socketReceive.Initialize("sockedReceive",9102,256)
socketSend.Initialize("sockedSend",9101,256)
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 msg As String
msg = BytesToString(PacketFromSender.Data, PacketFromSender.Offset, PacketFromSender.Length, "ASCII")
Dim b() As Byte= msg.GetBytes("ASCII")
Dim InviaUDP As UDPPacket
InviaUDP.Initialize(B,"192.168.1.249",9101)
socketSend.Send(InviaUDP)
End Sub
Sub sockedSend_PacketArrived (PacketFromSender As UDPPacket)
Log("Received from Receiver")
'...this is he on e that you are listening To
Dim msg As String
msg = BytesToString(PacketFromSender.Data, PacketFromSender.Offset, PacketFromSender.Length, "ASCII")
Dim b() As Byte= msg.GetBytes("ASCII")
Dim InviaUDP As UDPPacket
InviaUDP.Initialize(B,"192.168.1.169",9102)
socketReceive.Send(InviaUDP)
End Sub