Need help with a few questions regarding LE TCP Socket connection BP Plugin
Not sure this is the right place to ask, but here goes several questions:
Background:
I am connecting UE4 to my microcomputer via a web socket connection. The micro has a server that collects data and UE4 will use the data to update a static mesh actor on screen. I am using your TCP socket connection. UE4 BP is able to connect to my micro using the “Create Socket Connection (Not UDP and Not Raw)”. The server on the micro gets the connection and accepts it. Then from UE4 BP, I then send a test message using “Send Function Call”. The micro server sees the message come in as follows(colons only on debug for clarity):
02:4C:16:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F:50:51:52:53:54:55:56:
For testing, the server just changes the first byte to “03” and replies back:
03:4C:16:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F:50:51:52:53:54:55:56:
Question 1. The “Send Function Call” does not accept the response and fails out. Does the server have to send something else for the message to be acceptable on a Function Call response?
Question 2. How can the server properly determine when it will get 1 or 4 byte length and 1 or 4 Function ID bytes, for that matter. It seems random and can start a few messages with 1byte length and then after a few messages, the server starts getting 4 byte length fields/and or Function ID bytes, even though the message is always the same length. Will the first length byte always start with 0x80 if there are 4 bytes? Wiil the FunctionID also start with 0x80 on the first byte if there will be 4 bytes?
Here is a sample when server gets a 4-byte length message: 02:80:00:00:95:16:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F:50:51:52:53:54:55:56:
and the micro server responds as:03:80:00:00:95:16:41:42:43:44:45:46:47:48:49:4A:4B:4C:4D:4E:4F:50:51:52:53:54:55:56:
but this message gets rejected as well.
Question 3. Which Java Server example can I use to validate the “UE4 Send Function Call”. I tried Socket Examples 1-4 and none of them respond to the incoming Function Call requests. They just accept a connection and then disconnect.
Sorry if I missed something in your documentation, but I have read them over and over and watched your Youtube demo and can’t figure these things out.
Please point me in the right direction so that I can get back on track.
Thanks for a great product and I am sure I just missed something in the translation