Hi all,
I’m trying to use UDP in my game…
but I’m having trouble finding good examples…
I’m using DatagramSocket right now for my
server and client code. The main thing I’m getting
stuck on is, I have no problem making a server
app, and client app, and having the client app
send packets to the server. But is there a way
for the server app to send stuff back to the client
based on the packets sent from the client to the
server??
I think more specifically, from the server , I’m trying to
find a way to find out where the DatagramPacket
is sent from. I tried printing out the InetAddress
of the DatagramePacket, but it was of no use.
To my understanding… UDP is not connection base…
Do does that mean I can’t communicated back
and fourth using 1 instance of the UPD protocal?
I’m thinking if I should be using a DatagramChannel
on the server implementation instead… But I’m
having problems locating example code on the
internet. Also I have found serveral posts complaining
about the performance of the DatagramChannel
And advice would be appriciated.
Sorry for my amature knowledge in advance.
and much thanks.