Anonymous
I don't know how is that complex?
How can I know the disconnection status ??
Anonymous
For that Danya could help... I don't know Dev C++
I don't know either It's a piece of ...
Talula
How can I know the disconnection status ??
What is the server type, I mean HTTP, WebSocket,?
Anonymous
Its tcp/Ip through ethernet cable . Server is in Listening mode
Anonymous
I am using Qt creator
Anonymous
Server is Qtcpserver and socket
Talula
Hmm... the best way is to have a program on server that creates WebSocket... when this socket is disconnected an event will be fired, you can use that to clear the screen.
Anonymous
Websocket is not possible as per the Project architecture
Cat Wrestler
How can I know the disconnection status ??
https://doc.qt.io/qt-5/qabstractsocket.html#disconnected
Cat Wrestler
have you tried hooking to this signal?
Anonymous
Yes
Anonymous
No success
Anonymous
Error, statechanged, disconnect
Cat Wrestler
🤔
Anonymous
It works fine when client closes normally
Anonymous
Doesnt work if cable removed manually
Talula
In my opinion write a simple WebSocket Server on your server side, when client connects to the server it'll connect to that server too, if you take out the cable it will get disconnected and in ms it will fire the event.
Cat Wrestler
if it's a stream maybe you can treat it as disconnected if no data is received after a certain timeout ?
Anonymous
When i connect cable again, it works
Anonymous
I am not receiving FIN acknowledgment
Anonymous
My client is qtcpscket, implementing websocket is not allowed
Cat Wrestler
https://stackoverflow.com/questions/10445122/qtcpsocket-state-always-connected-even-unplugging-ethernet-wire
Cat Wrestler
i think you need a timeout then
Cat Wrestler
or use that setsockopt to change the keep alive segments
Talula
i think you need a timeout then
Timeout is really not a good option because if it's too short it'll do the time out on any error, if it's too long it'll be kinda pointless 5-10 seconds.
Shanks
http://gestyy.com/w5VYZ7
Anonymous
hello
Anonymous
hello
Cat Wrestler
Talula
i agree it's not the best but he doesn't seem to have other options?
Yeah create extra WebSocket Server... on the same server... and connect to it when system starts streaming... WebSocket will tell you in ms if your server disconnects.
Anonymous
I'm a human ,but I can't understand how to use the telegram.......
Anonymous
https://pastebin.com/ZkTuetht
There was a way on how to read the code you made in dev c, and it worked perfect, I just added some few extras pastebin .c om/hFG bWBWp
Anonymous
Thanks a lot
Anonymous
I need to create a time table with some constraints anybody
Anonymous
I need hlp
Anonymous
Do you want someone to do it for you?
Anonymous
No i need to someone clarify the problm
Abcd
Suggest some projects to be written in resume by C AND C ++
Anonymous
Anonymous
We can't know
Ander
Hi, I have a question about string manipulation in C: I have a variable called recv_buf that stores the response of an HTTP request: This is an example of that response: HTTP/1.1 200 OK Server: nginx/1.16.1 Date: Thu, 14 Nov 2019 16:25:05 GMT Content-Type: application/json Content-Length: 873 Connection: keep-alive Strict-Transport-Security: max-age=31536000; includeSubDomains; preload Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, OPTIONS Access-Control-Expose-Headers: Content-Length,Content-Type,Date,Server,Connection {"ok":true,"result":[{"update_id":954163176, "message":{"message_id":2442,"from":{"id":xxxxxxxxx,"is_bot":false,"first_name":"Ander","last_name":"Mutuberria","language_code":"es"},"chat":{"id":xxxxxxxxxx,"first_name":"Ander","last_name":"Mutuberria","type":"private"},"date":1573668830,"text":"Test"}},{"update_id":954163177, "message":{"message_id":2443,"from":{"id":xxxxxxxx,"is_bot":false,"first_name":"Ander","last_name":"Mutuberria","language_code":"es"},"chat":{"id":xxxxxxxxx,"first_name":"Ander","last_name":"Mutuberria","type":"private"},"date":1573669034,"text":"Test"}},{"update_id":954163178, "message":{"message_id":2444,"from":{"id":xxxxxxxxx,"is_bot":false,"first_name":"Ander","last_name":"Mutuberria","language_code":"es"},"chat":{"id":xxxxxxxxxx,"first_name":"Ander","last_name":"Mutuberria","type":"private"},"date":1573669972,"text":"Test"}}]} Do you know how can I extract from that char each "id" and "text" value and save it to a variable? Thanks, any idea is welcomed.
Talula
Improved version it'll stop if the pattern repeats.
Anonymous
Hi, I have a question about string manipulation in C: I have a variable called recv_buf that stores the response of an HTTP request: This is an example of that response: HTTP/1.1 200 OK Server: nginx/1.16.1 Date: Thu, 14 Nov 2019 16:25:05 GMT Content-Type: application/json Content-Length: 873 Connection: keep-alive Strict-Transport-Security: max-age=31536000; includeSubDomains; preload Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET, POST, OPTIONS Access-Control-Expose-Headers: Content-Length,Content-Type,Date,Server,Connection {"ok":true,"result":[{"update_id":954163176, "message":{"message_id":2442,"from":{"id":xxxxxxxxx,"is_bot":false,"first_name":"Ander","last_name":"Mutuberria","language_code":"es"},"chat":{"id":xxxxxxxxxx,"first_name":"Ander","last_name":"Mutuberria","type":"private"},"date":1573668830,"text":"Test"}},{"update_id":954163177, "message":{"message_id":2443,"from":{"id":xxxxxxxx,"is_bot":false,"first_name":"Ander","last_name":"Mutuberria","language_code":"es"},"chat":{"id":xxxxxxxxx,"first_name":"Ander","last_name":"Mutuberria","type":"private"},"date":1573669034,"text":"Test"}},{"update_id":954163178, "message":{"message_id":2444,"from":{"id":xxxxxxxxx,"is_bot":false,"first_name":"Ander","last_name":"Mutuberria","language_code":"es"},"chat":{"id":xxxxxxxxxx,"first_name":"Ander","last_name":"Mutuberria","type":"private"},"date":1573669972,"text":"Test"}}]} Do you know how can I extract from that char each "id" and "text" value and save it to a variable? Thanks, any idea is welcomed.
This looks like a json format response, correct me if I am wrong. Use a library?
Anonymous
Json manipulation library. Or if the string response is constant, you could make an interpreter/extractor for the ids.
Anonymous
Yeah json
Search for light weight library if you are making the c program for microcontroller
Augmented
hi friends, i just wonder, should i use #define macros with variadic parameters, or its better to stick with templates... i want to customise code to be compatible simultaneously with few platforms/frameworks... for example Arduino/MBED/CMSIS for STM32
Dipak
How Write psudeocode in cpp
klimi
you don't
Dipak
No
klimi
exactly
Anonymous
it wouldn't be pseudocode if you're writing it in C++
Anonymous
if you meant pseudocode for a C++ program you're planning then the same as with any other language since pseudocode is language-agnostic
Dipak
Write psudeocode to addition of two matrix
Francisco
Write psudeocode to addition of two matrix
Write it then. It's not C++. It's also really easy if you know how matrixes work
algorithm
hello guys
klimi
Hello girls
algorithm
what are specification statements used in c++ and which ones are they.
algorithm
whats that
i dont know also...we were given as assignment
klimi
._.
klimi
have a nice day
Anonymous
when creating a makefile, how do i run different command based on input
klimi
when creating a makefile, how do i run different command based on input
https://stackoverflow.com/questions/15977796/if-conditions-in-a-makefile-inside-a-target#30773906
klimi
Yeah first result