0

i have problem for Tcplistener And GT06.

I have the coding I wrote with c# TcpListener, there is no problem in data exchange.

I reply when the login message comes, but I get location information in long time intervals and then the connection ends why?

Then I get a heartbeat message then I reply and the connection ends why?

I'm sure the answers I gave are correct.

How can I retrieve data in 5-10 second intervals or continuously?

How should my coding be from the first stage, what should I do in order?

Current Action:

  1. Therminal to Server Login Message
  2. Server to Terminal Login Answer
  3. Therminal to Server Location Message
  4. Therminal to Server Location Message
  5. Connection Closed

Current My Code:

  1. Listen Port

  2. If Therminal to Server Login Message

a.Server to Terminal Login Answer

  1. If Therminal to Server Heartbeat Message

a. Server to Terminal Heartbeat Answer

  1. If Therminal to Server Location Message

a. print Message

  • I wrote a Concox server years ago and it is posted at stackoverflow in response to a posting. The connection will close if you do not respond quick enough or the response has errors. Best thing is to use a sniffer like wireshark or fiddler to debug issue. Look at last message. I had similar issues and found the documentation not to be clear. I was getting messages I wasn't expecting and had to add code to respond to the unexpected message. If I didn't respond to these message the client closed the connection. – jdweng Aug 27 '22 at 14:33
  • Merhaba, gelen isteklere doğru yanıt verdiğime eminim , fakat bunun dışında başka bir mesajda gelmiyor. Mesela bazen 1 adet giriş mesajı ve 2 adet lokasyon mesajı geliyor ve bağlantı kapanıyor. "lokasyon mesajları geldiğinde cevap göndermiyorum" , doğrumu ? – Murat Alıcılar Aug 27 '22 at 23:37
  • Read the specification. I believe all message must be acknowledged. – jdweng Aug 28 '22 at 00:47
  • use wireshark and post Therminal to Server Login Message , Server to Terminal Login Answer , terminal to Server Heartbeat Message and Server to Terminal Heartbeat Answer (hex format) – jellad.tarek Oct 12 '22 at 08:46

0 Answers0