Home > Back-end >  What's the problem, how to solve
What's the problem, how to solve

Time:10-11

Client. Exe of 0 x67034b7a (QtCored4. DLL) an unhandled exception: 0 xc0000005: access conflict while reading position 0 xac4984e0

Server. The exe 0 x67343e90 (QtCored4. DLL) an unhandled exception: 0 xc0000005: Access violation

CodePudding user response:

Is online download a Tcp client and server connection to send and receive, a "send" appears more than two questions

CodePudding user response:

No source code? It looks like visited an uninitialized pointer

CodePudding user response:

refer to the second floor ccrun response:
no source code? Looks like is visited an uninitialized pointer


The source code is this: http://liuyuananfang.blog.163.com/blog/static/843244212011118953799/

CodePudding user response:

Code is too long, don't have time to study, you step through it, and see which one tip error,

CodePudding user response:

reference 4 floor ccrun response:
code is too long, don't have time to study, you step through it, see which step prompt error, when


Server:

Void Server: : serverSendMessage ()
{
if(! ClientConnection)//judgment have instantiation
//if (! (clientConnection=tcpServer - & gt; NextPendingConnection ()))//no client connection
//{
//return;
//}
ServerMessage=UI. ServerMessagelineEdit - & gt; The text ();
If (serverMessage. IsEmpty ())
{
QMessageBox: : warning (this, tr (" Warnning "), the tr (" please enter the send data "));
return;
}
QByteArray block;
QDataStream out (& amp; Block, QIODevice: : WriteOnly);
Out. SetVersion (QDataStream: : Qt_4_6);
The out & lt; <(quint16) 0;
The out & lt; Out. Device () - & gt; Seek (0);
The out & lt; <(quint16) (block. The size () - sizeof (quint16));
The connect (clientConnection, SIGNAL (error (QAbstractSocket: : SocketError)),
This SLOT (displayErrorS (QAbstractSocket: : SocketError)));
ClientConnection - & gt; Write (block);
if (serverMessage. The contains (" serverStop "))
return;
here not
UI. ServertextBrowser - & gt; InsertPlainText (tr (" \ n "send message: % 1). Arg (serverMessage));
}

Error: Server. Exe of 0 x67034b7a unhandled exceptions: 0 xc0000005: while reading position 0 x00000004 access conflict

CodePudding user response:

reference 4 floor ccrun response:
code is too long, don't have time to study, you step through it, see which step prompt error, when


Client:

//the client sends information
Void Client: : clientSendMessage ()
{
ClientMessage=UI. TextlineEdit - & gt; The text ();
If (clientMessage. IsEmpty ())
{
QMessageBox: : warning (this, tr (" Warnning "), the tr (" please enter the send data "));
return;
}
QByteArray block;
QDataStream out (& amp; Block, QIODevice: : WriteOnly);
Out. SetVersion (QDataStream: : Qt_4_6);
The out & lt; <(quint16) 0;
The out & lt; Out. Device () - & gt; Seek (0);
The out & lt; <(quint16) (block. The size () - sizeof (quint16));
TcpClient - & gt; Write (block);
if (clientMessage. The contains (" clientStop "))
return;
is this sentence here
UI. MessagetextEdit - & gt; InsertPlainText (tr (" \ n "send message: % 1). Arg (clientMessage));
}

Client. Exe of 0 x67034b7a unhandled exceptions: 0 xc0000005: while reading position 0 x99557f2d access conflict

CodePudding user response:

If (clientMessage. The contains (" clientStop "))
return;
Don't know much about the meaning of this sentence

CodePudding user response:

Specific point??
  • Related