Results 1 to 7 of 7

Thread: Qt4 Windows Networking

  1. #1
    Join Date
    Mar 2006
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt4 Windows Networking

    Hi everyone,

    I need to copy files from a windows machine to a network server. Both run windows and the qt application is run on the client machine which needs to copy the files over to the server.

    This thing puzzles me because QNetwork have specific ftp and http code, but nothing more. This leads me to the conclusion that I will probably need to implement the smb protocol in some way.. which is totally wrong.

    Any ideas maybe?

    Tx

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt4 Windows Networking

    Maybe simply:
    a) transfer files over http protocol (one side of the communication is already done)
    or
    b) simply transfer files using sockets

    You don't need to implement any special protocol to do that. If you only need the actual data (meaning no need for filename, dates, etc.) then just send the data through socket and accept it on the other size. You may want to send the size of the file as the first word of communication to know if you already received the whole transmission.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4 Windows Networking

    Can't you just map server's share on the client? This way you can copy files just as if it was a local disk.

  4. #4
    Join Date
    Mar 2006
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4 Windows Networking

    The idea is that there is no interaction from the user. No mapping of network drives thus.
    Also, this client does not run on the server so I need to use windows samba networking like in: \\server\share

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt4 Windows Networking

    So maybe it'd be easier to use the native Samba interface? Does your application need to be portable?

  6. #6
    Join Date
    Mar 2006
    Posts
    14
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4 Windows Networking

    The application wont be used on linux. only windows xp and 2000 so partability is not that much of an issue

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt4 Windows Networking

    Quote Originally Posted by bothapn View Post
    The idea is that there is no interaction from the user. No mapping of network drives thus.
    Also, this client does not run on the server so I need to use windows samba networking like in: \\server\share
    Have you tried this?
    Qt Code:
    1. QFile f( "\\\\server\\share\\file.txt" );
    2. f.open( QIODevice::WriteOnly | QIODevice::Text );
    3. QTextStream( &f ) << "aaa";
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Deploying with MySQL support under Windows
    By KShots in forum Installation and Deployment
    Replies: 1
    Last Post: 12th October 2006, 09:19
  2. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 01:00
  3. Experience using KDevelop with Cygwin under windows
    By high_flyer in forum General Discussion
    Replies: 4
    Last Post: 11th September 2006, 16:50
  4. qt and mingw can not run on windows 98?
    By evewei in forum Installation and Deployment
    Replies: 4
    Last Post: 26th June 2006, 09:22
  5. MDI windows without QWorkspace
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 16th June 2006, 17:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.