Home > Back-end >  C the websocket server to send
C the websocket server to send

Time:09-25

Websocket client is HTML 5, the server is A c + + socket, now A handshake is successful, the client sends the websocket message server can parse it out correctly, but the server sends data, the client not receive, use Google browser debugging A report server must not mask any frames that it sends to the client. The error, but the same program written in c # can send success,
C + + code sent (only post & lt; 126, my hair is very little data) : int sum=0;
Char outmsg [2048].
Memset (outmsg, 0, sizeof (outmsg));
Outmsg [sum++]=130;
If (nSize & lt; 126)
{
Outmsg [sum++]=nSize;
}

Memcpy (& amp; Outmsg [sum], pData, nSize);
The sum +=nSize;
The pKey - & gt; M_WriteBufferQueue. Write (outmsg, sum);
Caught by caught tools and c + + and c # sent to the client's bag is the same, but why c + + client error, and c # is not an error,

CodePudding user response:

The building Lord have to solve this problem!!!!!!

CodePudding user response:

The original poster hello, I also met you that kind of problem, the difference is that I did not use c #, I use Java can pass, you have to solve the problem?

CodePudding user response:

How to solve of, how the later went out there!

CodePudding user response:

I also encountered the same problem, temporarily no problem, but the check information about problems: to locate the server as the client sends the data to send 1 byte

CodePudding user response:

Send one more '\ 0' look
  • Related