Zapit-Optostim / zapit

General purpose optostimulation system
GNU Lesser General Public License v2.1
6 stars 1 forks source link

Changing the tcp-ip communication protocol #125

Closed Peter-Vincent closed 1 year ago

Peter-Vincent commented 1 year ago

Updates to the client and server code to allow for inter-process, -network and -language communication with Zapit.

raacampbell commented 1 year ago

What is the idea behind the second commit (the "different memory one")?

raacampbell commented 1 year ago

Also, did you switch the line endings from Unix to Windows in the first commit? All the lines are listed as changes, which makes it hard to see what has altered. I'll take a look more carefully soon.

Peter-Vincent commented 1 year ago

Messages to the server are different from messages received from the server, since the received messages contain a timestamp. This means we can't default to reading the same number of bytes from the buffer, similarly the readDataFnc would need to be different and the structure of the buffer is also not shared. The second commit extracts these components from the tcpip parent class and implements them directly into the client and server classes. DIfferent memory should be memory layout - referring to the buffer struct interpreting the message in different ways depending on if its client or server.

Peter-Vincent commented 1 year ago

Oh damn, yes it looks like it did. Sorry about that, do you know how I can undo that?

raacampbell commented 1 year ago

Oh damn, yes it looks like it did. Sorry about that, do you know how I can undo that?

There is a bash script in the repo that fixes all files. Otherwise you just have change in your editor and re-save. Then push the changes.

Git was randomly changing large numbers of files over and I stopped that with a config setting somwhere in the .git directory. I don't think that setting blocks you from manually changing the line endings, though.