| | |
How to transport a file with QTcpSock in LAN?
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Hello,everybody!
I'm writing a LAN communication programming,and I need to transport a file between different host computer.
I know that the TCP is a kind of stream-oriented connection.But look at the fallowing codes:
I don't think it's a stream but a segment,do I?
And my other question is how to transport a file by TcpSocket.
I am Chinese,so the file may not be Enlish single,and the file may be alse a binary data file. How do I transport it?
I know that my English is poor,but I will try my best to exchange it!
Help me,please!
Thank anybody who look at this thread!
By the way, I had another question: what's the meaning of "hen & egg problem"(I'm not a English mother language men).
I'm writing a LAN communication programming,and I need to transport a file between different host computer.
I know that the TCP is a kind of stream-oriented connection.But look at the fallowing codes:
C++ Syntax (Toggle Plain Text)
void TripPlanner::sendRequest() { QByteArray block; out << quint16(0) << quint8('S') << fromComboBox->currentText() << toComboBox->currentText() << dateEdit->date() << timeEdit->time(); if (departureRadioButton->isChecked()) { out << quint8('D'); } else { out << quint8('A'); } out.device()->seek(0); out << quint16(block.size() - sizeof(quint16)); tcpSocket.write(block); statusLabel->setText(tr("Sending request...")); }
And my other question is how to transport a file by TcpSocket.
I am Chinese,so the file may not be Enlish single,and the file may be alse a binary data file. How do I transport it?
I know that my English is poor,but I will try my best to exchange it!
Help me,please!
Thank anybody who look at this thread!
By the way, I had another question: what's the meaning of "hen & egg problem"(I'm not a English mother language men).
Last edited by cscgal; Nov 18th, 2007 at 4:34 pm. Reason: Added code tags
chicken & egg proglem
If the file contains binary representation of integers then the bytes may have to be reversed on the receiving os. This is common problem when transferring files between MS-Windowos and *nix/Unix -- big endian little endian
As for your specific question -- I don't know, sorry.
If the file contains binary representation of integers then the bytes may have to be reversed on the receiving os. This is common problem when transferring files between MS-Windowos and *nix/Unix -- big endian little endian
As for your specific question -- I don't know, sorry.
Last edited by Ancient Dragon; Nov 18th, 2007 at 4:46 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
•
•
chicken & egg proglem
Thanks! Maybe I could find it in google by myself first, I'm sorry for my lazy.
If the file contains binary representation of integers then the bytes may have to be reversed on the receiving os. This is common problem when transferring files between MS-Windowos and *nix/Unix -- big endian little endian
This is important for me. I guess that Qt may encapsulate it in an easy way.
As for your specific question -- I don't know, sorry.
![]() |
Similar Threads
- XP Network can't share files or printer (Networking Hardware Configuration)
- Problems with XP/Vista/Linksys Network (Networking Hardware Configuration)
- Read XML File in C/C++ (C++)
- Slow wireless LAN (Networking Hardware Configuration)
- sending files over LAN thru C programs (C++)
- Increase BROADBAND (Windows tips 'n' tweaks)
- Maxtor HDD!!! (Storage)
- How to use wifstream to read a unicode file.. (C++)
- About;Blank Please Help, Hijack Log File (Viruses, Spyware and other Nasties)
- Wi-fi Network (Networking Hardware Configuration)
Other Threads in the C++ Forum
- Previous Thread: Return function
- Next Thread: program with error
Views: 875 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






