0

I have a GPS device that is using protobuf.

As i know, for sending data to a server using protobuf, must be at least a service specified in .proto files, and implement that service to get data.

But in the documentation and .proto files in that document (file1, file2) does not mention any service. How can i get data from this device, using Java, Spring boot when there is no service in .proto files?

Mahdiyar
  • 51
  • 9
  • 2
    "must be at least a service specified" - only if using gRPC; you can also use protobuf to encode data and send it in another way (e.g. TCP, MQTT, Serial, etc). It looks like your device is using protobuf to encode data but sending it via TCP as part of a "Device Packet" so you will need to listen for TCP connections and then handle the inbound device packets. – Brits Jul 09 '22 at 23:04
  • So how can i "listen to a TCP connection"? I just created a Spring Boot app, and it starts tomcat as server on port 8080, how can i listen to a tcp connection in this project? I just created Restful projects that use HTTP methods (POST, GET and ...) – Mahdiyar Jul 10 '22 at 12:22
  • Seems like it's something you configure? _"then it connects to the server whose address is specified in the its configuration and transmits the data to the server."_ – Andrew Cheong Jul 10 '22 at 17:32
  • The "Configuration" part happens in GPS device, they are not related to me, i just tell them my machine IP Address and port, and they set it on the device. The only problem is getting data from device. Is ServerSocket a good solution for that? – Mahdiyar Jul 10 '22 at 19:24
  • @Mahdiyar [this question](https://stackoverflow.com/q/64394292/11810946) might provide a starting point (if you have not dealt with TCP connections previously then you may need to start with [the basics](https://docs.oracle.com/javase/tutorial/networking/sockets/index.html)). – Brits Jul 10 '22 at 20:06
  • @Brits I created a ServerSocket in my project and now i can see that the device is sending data to me and i can receive it, but because it is using SSL, the data that i receive is not readable, how can i config nginx to accept such connections, behind the SSL? i config it for normal HTTP requests, but that does not work for TCP connections – Mahdiyar Jul 11 '22 at 06:05
  • That's probably best raised as a seperate question (if there is not already an answer) as the comments is not really a good place for additional questions (and this question is not tagged with `nginx`). I seem to remember that SSL is optional. – Brits Jul 11 '22 at 06:18
  • @Brits i asked the question, i will appreciate if you could look at it, https://stackoverflow.com/questions/72935982/nginx-blocks-serversocket-communication-in-java – Mahdiyar Jul 11 '22 at 10:12

0 Answers0