Hi all
I am developing a B4J server to act as PTT server, the B4A client is currently based on Erels PTT Wifi Code (modified to work with UDP, removed BT etc). The B4J server is purely using UDP sockets. The server has 2 class's, each class has a UDP socket in it.
The first class, the listen class is used to register a user so they can hear the audio, the other class is to handle a user user is speaking. There is a much bigger picture behind all of this.
Wen a client connects to the listen class the i.e
The problem I am having is the simple "hello" response packet is not be returned to the client.
Anyone have any thoughts on this ?
Regards
John.
I am developing a B4J server to act as PTT server, the B4A client is currently based on Erels PTT Wifi Code (modified to work with UDP, removed BT etc). The B4J server is purely using UDP sockets. The server has 2 class's, each class has a UDP socket in it.
The first class, the listen class is used to register a user so they can hear the audio, the other class is to handle a user user is speaking. There is a much bigger picture behind all of this.
Wen a client connects to the listen class the i.e
B4X:
private Sub udp_PacketArrived (Packet As UDPPacket)
Dim connection As tConnection
connection.Initialize
connection.imei = BytesToString(Packet.Data,Packet.Offset, Packet.Length,"UTF-8")
connection.last_ping = DateTime.Now
connection.rhost = Packet.HostAddress
connection.rport = Packet.Port
connections.Put(connection.imei,connection)
Log("LISTEN " & DateTime.Time(DateTime.Now) & " - " & _
connection.rhost & ":" & connection.rport & " - " & connection.imei )
' // we are testing a response
Dim p As UDPPacket, res As String = "hello " & connection.imei
Dim data() As Byte = res.GetBytes("UTF8")
p.Initialize(data, Packet.HostAddress,Packet.Port)
socketUDP.Send(p)
End Sub
The problem I am having is the simple "hello" response packet is not be returned to the client.
Anyone have any thoughts on this ?
Regards
John.
Last edited: