- Timestamp:
- Mar 18, 2008, 10:18:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/test_bnc_qt.cpp
r633 r733 57 57 58 58 QTcpSocket socketObs; 59 QTcpSocket socketEph;59 //// QTcpSocket socketEph; 60 60 61 61 QFile obsFile("obs.txt"); 62 QFile ephFile("eph.txt");62 //// QFile ephFile("eph.txt"); 63 63 64 64 socketObs.connectToHost("127.0.0.1", 1968); … … 68 68 } 69 69 70 socketEph.connectToHost("127.0.0.1", 1969);71 if (!socketEph.waitForConnected(10000)) {72 cout << "socketEph: not connected" << endl;73 exit(1);74 }70 //// socketEph.connectToHost("127.0.0.1", 1969); 71 //// if (!socketEph.waitForConnected(10000)) { 72 //// cout << "socketEph: not connected" << endl; 73 //// exit(1); 74 //// } 75 75 76 76 obsFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered); 77 ephFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered);77 //// ephFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered); 78 78 79 79 QTextStream outObs(&obsFile); 80 80 outObs.setRealNumberNotation(QTextStream::FixedNotation); 81 81 82 QTextStream outEph(&ephFile);83 outEph.setRealNumberNotation(QTextStream::FixedNotation);82 //// QTextStream outEph(&ephFile); 83 //// outEph.setRealNumberNotation(QTextStream::FixedNotation); 84 84 85 85 // Receive Data … … 94 94 exit(0); 95 95 } 96 if (socketEph.state() != QAbstractSocket::ConnectedState) {97 cout << "socketEph: disconnected" << endl;98 exit(0);99 }96 //// if (socketEph.state() != QAbstractSocket::ConnectedState) { 97 //// cout << "socketEph: disconnected" << endl; 98 //// exit(0); 99 //// } 100 100 101 101 if ( socketObs.bytesAvailable() ) { … … 125 125 } 126 126 127 if ( socketEph.bytesAvailable() ) {128 QByteArray eph = socketEph.readAll();129 outEph << eph.data() << endl;130 }131 else {132 socketEph.waitForReadyRead(1);133 }127 //// if ( socketEph.bytesAvailable() ) { 128 //// QByteArray eph = socketEph.readAll(); 129 //// outEph << eph.data() << endl; 130 //// } 131 //// else { 132 //// socketEph.waitForReadyRead(1); 133 //// } 134 134 } 135 135
Note:
See TracChangeset
for help on using the changeset viewer.