Im trying to get bi-directional UDP to work so that I can get flightgear talking to a python script I've written. I've been able to get UDP communicating properly using output only, but as soon as I switch to bidirectional protocol, I stop receiving any data. Does UDP support bidirectional protocol? Do I need to send some sort of handshake? I've tried simply sending some data back to FG before receiving, however, that just ends up with the sent data being bounced back at me. Im using the following command line arguments:
--generic=socket,out,5,localhost,5500,udp,FightData (Works!)
--generic=socket,bi,5,localhost,5500,udp,FightData (Doesn't Work)
And here's the python script I'm working with (which very well may be the problem):
- Code (): Select all
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('localhost',5500))
print('connected to ',sock)
while True:
data = sock.recv(1024)
print(data)
any ideas or help is really appreciated!