equal
deleted
inserted
replaced
49 { |
49 { |
50 if(IPCSocket) { |
50 if(IPCSocket) { |
51 // connection should be already finished |
51 // connection should be already finished |
52 return; |
52 return; |
53 } |
53 } |
54 QTcpSocket * client = IPCServer->nextPendingConnection(); |
54 IPCSocket = IPCServer->nextPendingConnection(); |
55 if(!client) return; |
55 if(!IPCSocket) return; |
56 IPCSocket = client; |
56 connect(IPCSocket, SIGNAL(disconnected()), this, SLOT(ClientDisconnect())); |
57 connect(client, SIGNAL(disconnected()), this, SLOT(ClientDisconnect())); |
57 connect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead())); |
58 connect(client, SIGNAL(readyRead()), this, SLOT(ClientRead())); |
|
59 SendToClientFirst(); |
58 SendToClientFirst(); |
60 } |
59 } |
61 |
60 |
62 void TCPBase::RealStart() |
61 void TCPBase::RealStart() |
63 { |
62 { |
72 } |
71 } |
73 |
72 |
74 void TCPBase::ClientDisconnect() |
73 void TCPBase::ClientDisconnect() |
75 { |
74 { |
76 IPCSocket->close(); |
75 IPCSocket->close(); |
|
76 delete IPCSocket; |
|
77 IPCSocket = 0; |
77 |
78 |
78 onClientDisconnect(); |
79 onClientDisconnect(); |
79 |
80 |
80 readbuffer.clear(); |
81 readbuffer.clear(); |
81 |
82 |