in Education by
I use a QWebSocketServer with Qt5.8. Most of the WebSocket clients have no troubles connecting to it, but one of them provokes a singular behaviour. Below is the WireShark capture I get with this client (client 10.8.0.1, server 10.8.0.8). 10.8.0.1 10.8.0.8 TCP 44 51331 → 8888 [SYN] Seq=0 Win=2920 Len=0 MSS=1355 10.8.0.8 10.8.0.1 TCP 44 8888 → 51331 [SYN, ACK] Seq=0 Ack=1 Win=29200 Len=0 MSS=1460 10.8.0.1 10.8.0.8 TCP 40 51331 → 8888 [ACK] Seq=1 Ack=1 Win=2920 Len=0 10.8.0.1 10.8.0.8 TCP 64 51331 → 8888 [PSH, ACK] Seq=1 Ack=1 Win=2920 Len=24 [TCP segment of a reassembled PDU] 10.8.0.8 10.8.0.1 TCP 40 8888 → 51331 [ACK] Seq=1 Ack=25 Win=29200 Len=0 10.8.0.8 10.8.0.1 TCP 40 8888 → 51331 [FIN, ACK] Seq=1 Ack=25 Win=29200 Len=0 10.8.0.1 10.8.0.8 HTTP 209 GET /example HTTP/1.1 10.8.0.8 10.8.0.1 TCP 40 8888 → 51331 [RST] Seq=1 Win=0 Len=0 10.8.0.1 10.8.0.8 TCP 40 51331 → 8888 [ACK] Seq=194 Ack=2 Win=2919 Len=0 10.8.0.8 10.8.0.1 TCP 40 8888 → 51331 [RST] Seq=2 Win=0 Len=0 10.8.0.1 10.8.0.8 TCP 40 51331 → 8888 [FIN, ACK] Seq=194 Ack=2 Win=2919 Len=0 10.8.0.8 10.8.0.1 TCP 40 8888 → 51331 [RST] Seq=2 Win=0 Len=0 Below is the WireShark capture I get from a working client connecting to the same server (client 192.168.1.48, server 192.168.1.111). 192.168.1.48 192.168.1.111 TCP 74 37556 → 8888 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=7880001 TSecr=0 WS=16 192.168.1.111 192.168.1.48 TCP 74 8888 → 37556 [SYN, ACK] Seq=0 Ack=1 Win=28960 Len=0 MSS=1460 SACK_PERM=1 TSval=3996923817 TSecr=7880001 WS=128 192.168.1.48 192.168.1.111 TCP 66 37556 → 8888 [ACK] Seq=1 Ack=1 Win=29200 Len=0 TSval=7880013 TSecr=3996923817 192.168.1.48 192.168.1.111 HTTP 264 GET /example HTTP/1.1 192.168.1.111 192.168.1.48 TCP 66 8888 → 37556 [ACK] Seq=1 Ack=199 Win=30080 Len=0 TSval=3996923820 TSecr=7880013 192.168.1.111 192.168.1.48 HTTP 540 HTTP/1.1 101 Switching Protocols Continuation 192.168.1.48 192.168.1.111 TCP 66 37556 → 8888 [ACK] Seq=199 Ack=475 Win=30272 Len=0 TSval=7880034 TSecr=3996924025 192.168.1.48 192.168.1.111 WebSocket 136 WebSocket Text [FIN] [MASKED] As far as I understand, in the first case, my QWebSocketServer implementation sends a [FIN] message for a reason I don't understand, before the client can send its HTTP Upgrade Get Request. Could that be caused by the fact the first client sends [PSH,ACK] TCP message whereas the second does not ? Who is not compliant with the WebSocket protocol here ? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I just found this Qt bug report that explains my situation. As stated by Timur Pocheptsov, this appears to be a known bug that would require a major QWebSockets refactoring to fix. Unfortunately, it's by design so: QWebSocketHandshakeRequest tries to parse a client's handshake and sees nothing except this line, it considers such a request invalid and then QWebsocketServerPrivate::handshakeReceived closes the connection. A major re-write/re-design in qtwebsockets is needed to handle this correctly.

Related questions

0 votes
    Write a program which sends the name of a text file from the client to server and display the message on the ... file present or not. Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    I am using php oauth2 library from this github repo. PHP oauth2 library Whenever i send a refresh token, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    When a query is submitted in Drill, client/application sends the query in the form of an _____________ to Drillbit in a ... of the options c)None of the options d)NoSQL statement...
asked Dec 11, 2020 in Education by Editorial Staff
0 votes
    If a client sends an XML request to a server, can we ensure that the communication remains confidential?...
asked Nov 7, 2020 in Education by Editorial Staff
0 votes
    What does the browser do to set up a TCP/IP connection? (a) TCP one-way handshake (b) TCP two- ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which of them is not a standard flag used in TCP communication between client and server? (a) Synchronize ... -for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Nov 1, 2021 in Education by JackTerrance
0 votes
    A __________ is a program running on the server machine, which accepts requests from a Web ... Fundamentals in division Database Programming Techniques of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    Assymmetric Encryption: Why can a message encrypted with the Public Key only be decrypted with the ... topic in portion Database Programming Techniques of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    I am experimenting Barba.js for page transitions. When I try to run this code I get a "Blocked ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    i am a newbie to scraping and selenium. The page which i want to scrape uses a js script on a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I've got a local .mdf SQL database file that I am using for an integration testing project. Everything ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 16, 2022 in Education by JackTerrance
0 votes
    Question 15: 15. .is a type of response test used in computing as an attempt to ensure that the response is ... code c) New code Select the correct answer from above options...
asked Dec 15, 2021 in Education by JackTerrance
0 votes
    An attempt to harm, damage or cause threat to a system or network is broadly termed as ______ (a) Cyber-crime ... Security questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 5, 2021 in Education by JackTerrance
0 votes
    ____________ is an attempt to steal, spy, damage or destroy computer systems, networks or their associated information. ( ... questions and answers pdf, mcq on Cyber Security pdf,...
asked Nov 4, 2021 in Education by JackTerrance
...