Bookmark Topic Watch Topic
  • New Topic

HeartBeat response to client

 
Gerald Amalraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator
In my client server socket Java programming, I'm receiving 18 bytes data from client(read from a tracking device) to my server, after some research on this 18 bytes data I presume that this 18 bytes are so called Heart Beat packets and I need to acknowledge the client with some Heart Beat response packet which I don't how to do it.

Kindly guide. I happy to post my code also which is very simple and LOC is minimal if that gives a clear picture.

I would really appreciate if anyone could give me some code examples on how to send the Heart Beat Package back to client.
 
Henry Wong
author
Sheriff
Posts: 22516
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
Gerald Amalraj wrote:
I would really appreciate if anyone could give me some code examples on how to send the Heart Beat Package back to client.


Heart beats are part of many protocols, and there are countless ways to do it -- as they are part of the protocol itself. Heck, even the raw TCP protocol, optionally, has the implementation of a heart beat mechanism. There is no one standard way of determining what is a heart beat, and no standard way for responding to a heartbeat.

You will need to implement it as designed by the specification that you are using. We can't help you as we don't have a clue what that specification is.

Henry
 
Gerald Amalraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm implementing a logic for a GPS tracking device (GT02). Client being the GPS tracker and server which I'm using to read the data sent from the tracker.

I'm receiving a 18 bytes data which I found out to be a Heart Beat data packet which doesn't contain the co-ordinates/latitude & longitude.

It is said that I need to send a Heart Beat data packet as response to the client[I'm stuck here].

I need to send the byte as a response to the client in my case Gps tracker the byte[] response = {0x54, 0x68, 0x1A, 0x0D, 0x0A};

PS: I'm using TCP for data transfer
 
Henry Wong
author
Sheriff
Posts: 22516
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Gerald Amalraj wrote:
It is said that I need to send a Heart Beat data packet as response to the client[I'm stuck here].

I need to send the byte as a response to the client in my case Gps tracker the byte[] response = {0x54, 0x68, 0x1A, 0x0D, 0x0A};


I guess I am missing the issue here. You know what to send. You know what triggers it. So... what is the issue?

Henry
 
Gerald Amalraj
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have been using TK06A GPS tracker and I 'm developing my own server java file and I have received the initial login message packet as per the manual and now I need to send back the ack to the device to get the GPS message packet.

I am not getting the GPS message packet which holds the coordinates. I'm adding the code below. I'm sure that till obtaining the IMEI number in the LOC is correct and I'm having problems in the outputstream. I don't know where am I going wrong.

Kindly help

 
Henry Wong
author
Sheriff
Posts: 22516
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator

So, it isn't clear if this even has to do with heartbeats. Basically, you are having issues, and don't seem to be able to debug it... Anyway, this seems to also be the same as your other topic.

http://www.coderanch.com/t/644050/sockets/java/Gps-Coordinates-fetch-algorithm

So, I will close this one.

Henry
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!