Not Able Stream Quotes using WebSocket

kontacthimanshu
Hello,

I am trying to stream quotes using my .Net/C# client with the WebSocket endpoint wss://ws.kite.trade. My client is able to make the connection successfully but when I try to send a message to get quotes for INFY('408065'), I am getting an exception "The remote party closed the WebSocket connection without completing the close handshake.".

I am wondering why my connection is being closed by the server. Can you please help me? Many thanks.
  • rakeshr
    I am getting an exception "The remote party closed the WebSocket connection without completing the close handshake."
    Is this happening because of any code side error? Can you paste the complete error stack trace here
    You can check the example WebSocket Code for .Net/C# client here.
  • kontacthimanshu
    It seems to be working today. Though I am surprised to see that for one request I have 8827 packets for INFY. Is it because I have tested the App over the weekend and made so many requests so all those requests are being served now?
  • kontacthimanshu
    I am using your WebSocket code only and here is the stack trace:
    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
    at System.Threading.Tasks.Task`1.get_Result()
    at IntelliTrade.DataAccess.WebSocket.<>c__DisplayClass18_0.b__0(Task`1 t) in D:\AntianIntelliTrade\Antian\IntelliTrade.DataAccess\WebSocketImpl.cs:line 103
  • kontacthimanshu
    I am able to connect successfully now but I am not sure if I am sending requests correctly. For example to get INFY's tics I am sending two messages:
    One is:
    {"a": "subscribe", "v": [408065]};
    and second is:
    {"a":"mode", "v":["full",[408065]]}
    But as soon as messages are sent I get tons (8827) of packets which values as 0 for most fields like LTP, instrument_token.

    Please suggest what I am doing wrong.
  • kontacthimanshu
    I am able to get data now. Please close.
This discussion has been closed.