- Timestamp:
- Dec 18, 2007, 4:24:26 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncapp.cpp
r621 r642 43 43 #include <QMessageBox> 44 44 #include <cmath> 45 #include <unistd.h> 45 46 46 47 #include "bncapp.h" … … 524 525 // ---------------------- 525 526 if (_sockets) { 526 Q ListIterator<QTcpSocket*> is(*_sockets);527 QMutableListIterator<QTcpSocket*> is(*_sockets); 527 528 while (is.hasNext()) { 528 529 QTcpSocket* sock = is.next(); 529 530 if (sock->state() == QAbstractSocket::ConnectedState) { 530 sock->write(allLines); 531 int fd = sock->socketDescriptor(); 532 if (::write(fd, allLines.data(), allLines.size()) != allLines.size()) { 533 delete sock; 534 is.remove(); 535 } 536 } 537 else if (sock->state() != QAbstractSocket::ConnectingState) { 538 delete sock; 539 is.remove(); 531 540 } 532 541 } … … 590 599 // ---------------------- 591 600 if (_sockets) { 592 Q ListIterator<QTcpSocket*> is(*_sockets);601 QMutableListIterator<QTcpSocket*> is(*_sockets); 593 602 while (is.hasNext()) { 594 603 QTcpSocket* sock = is.next(); 595 604 if (sock->state() == QAbstractSocket::ConnectedState) { 596 sock->write(allLines); 605 int fd = sock->socketDescriptor(); 606 if (::write(fd, allLines.data(), allLines.size()) != allLines.size()) { 607 delete sock; 608 is.remove(); 609 } 610 } 611 else if (sock->state() != QAbstractSocket::ConnectingState) { 612 delete sock; 613 is.remove(); 597 614 } 598 615 }
Note:
See TracChangeset
for help on using the changeset viewer.