Code mismatch between PacketClient (cpp project) and PythonClient (python project)
Posted: Thu Jan 09, 2020 5:53 am
Hi,
Since my client runs on a linux machine, I'm working with the PythonClient sample as a starting point.
I've notice that if I run the <PythonSample.py> as is, no data is received.
However if I'm adding to the run() function a NAT_PING command, then the server start streaming data continuously (forever).
First, it seems very strange that this is what a NAT_PING command does...
Later, I took a look at the PacketClient sample (cpp project) and there I saw that the NATNET message ids doesn't include NAT_PING, but instead it has a NAT_CONNECT command (which is now make sense why the NAT_PING command did something that causes the server to stream...).
Moreover, regarding the following definition (in the python sample):
NAT_PING = 0 // also known as NAT_CONNECT at the cpp sample
NAT_PINGRESPONSE = 1 // also known as NAT_SERVERINFO at the cpp sample
NAT_REQUEST = 2
NAT_RESPONSE = 3
NAT_REQUEST_MODELDEF = 4
NAT_MODELDEF = 5
NAT_REQUEST_FRAMEOFDATA = 6"
NAT_FRAMEOFDATA = 7
NAT_MESSAGESTRING = 8
NAT_DISCONNECT = 9
NAT_UNRECOGNIZED_REQUEST = 100
I've notice that the only messages that I'm getting a valid response from, are NAT_PING/NAT_CONNECT and NAT_REQUEST_MODELDEF.
The other commands are failing when trying to parse the response, or I'm getting an error of "received unrecognized request from server".
Is there something more updated (a code or a document) to learn and understand the protocol ?
After sending the NAT_PING/NAT_CONNECT command, the data start streaming. That's a great start. Is there a command that can stop the streaming ?
Even only a partial answer will be much appreciated,
Thanks,
Joseph
Since my client runs on a linux machine, I'm working with the PythonClient sample as a starting point.
I've notice that if I run the <PythonSample.py> as is, no data is received.
However if I'm adding to the run() function a NAT_PING command, then the server start streaming data continuously (forever).
First, it seems very strange that this is what a NAT_PING command does...
Later, I took a look at the PacketClient sample (cpp project) and there I saw that the NATNET message ids doesn't include NAT_PING, but instead it has a NAT_CONNECT command (which is now make sense why the NAT_PING command did something that causes the server to stream...).
Moreover, regarding the following definition (in the python sample):
NAT_PING = 0 // also known as NAT_CONNECT at the cpp sample
NAT_PINGRESPONSE = 1 // also known as NAT_SERVERINFO at the cpp sample
NAT_REQUEST = 2
NAT_RESPONSE = 3
NAT_REQUEST_MODELDEF = 4
NAT_MODELDEF = 5
NAT_REQUEST_FRAMEOFDATA = 6"
NAT_FRAMEOFDATA = 7
NAT_MESSAGESTRING = 8
NAT_DISCONNECT = 9
NAT_UNRECOGNIZED_REQUEST = 100
I've notice that the only messages that I'm getting a valid response from, are NAT_PING/NAT_CONNECT and NAT_REQUEST_MODELDEF.
The other commands are failing when trying to parse the response, or I'm getting an error of "received unrecognized request from server".
Is there something more updated (a code or a document) to learn and understand the protocol ?
After sending the NAT_PING/NAT_CONNECT command, the data start streaming. That's a great start. Is there a command that can stop the streaming ?
Even only a partial answer will be much appreciated,
Thanks,
Joseph