Text data received in Websocket

AntonyPrakash
Yesterday I received " {"t":11,"p":"Square off your ITM (In the money) Bank Nifty options expiring today to avoid paying excess STT. "} " (112 bytes). The data supposed to be received through websocket is binary. Also there is no header (or) identifier which could be used to identify the packet type as the first 8 bytes denote packet number and size of first packet. so the text data causes my program to crash. Previously I used to get such data with ~ 19 bytes, which I ignore based on size. Is there a clear documentation to wesocket since the api documentation does not explain this behaviour...
  • sujith
    Hi @AntonyPrakash,
    This is terminal messages which are displayed on Kite. Since API clients don't have UI, we thought it won't be of any use. If you want we can give you more information.
  • AntonyPrakash
    Hi sujith, can u give me how to detect these messages. I can check " {"t": " ie., first 5 bytes to detect this, this will be a workaround and my program will still fail is something like " {"X": " is encountered. so I guess "t" means terminal message. please confirm that the only text message sent through websockets is terminal message, if more types of messages may be sent, please give me the list so I can set identifiers so my program can detect them as text messages.
  • sujith
    Hi @AntonyPrakash,
    Pretty much all the text messages are specific to our platforms.
    You should be bothering about binary messages only. Just ignore all text messages.
  • AntonyPrakash
    Thanks Sujith... I had put identifiers for text messages and ignoring them... seems to work fine now.
This discussion has been closed.