Can't make ProtoHeartbeatEvent work

Created at 23 Jun 2023, 12:42
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
MA

manelfx9530

Joined 16.10.2019

Can't make ProtoHeartbeatEvent work
23 Jun 2023, 12:42


Hi, this is my code for heartbeat event but i'm getting errors and not a response back. Can someone help me or show me a proper way to write the code please?
 

def sendProtoHeartbeatEvent():

     print('Sending heartbeat...')

     client = Client(host, EndPoints.PROTOBUF_PORT, TcpProtocol)

     request = ProtoHeartbeatEvent()

     deferred = client.send(request, responseTimeoutInSeconds=10)

     deferred.addErrback(onError)


@manelfx9530
Replies

manelfx9530
23 Jun 2023, 12:54 ( Updated at: 23 Jun 2023, 12:55 )

Its working now. First it gives an error but then I start getting messages from ProtoHeartbeatEvent.

 

 

 


@manelfx9530