Link to home
Start Free TrialLog in
Avatar of James Hancock
James HancockFlag for United States of America

asked on

python UDP how do I specify an IP destination?

Hi,

In my UDP, python, server client system, an RTS, how does my client specify the IP address location of the server? - with a HELO type message in a byte array
What does the client send region look like? and the server receive loop?
Do game servers first have a client-join loop and THEN a gameplay loop, or one loop for everything?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of gelonida
gelonida
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Hancock

ASKER

Thanks

I think that is good. I have datagrams sending and receiving.
But, on the receiver end, how do I pick apart the data?



In
data, addr = s.recvfrom(1024)

is data the exact byte array I send from the client? How do I parse the individual bytes?
I usually have data[0] byte as the message type code
and the subsequent bytes, the relevant data for the message.

?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial