Results 1 to 4 of 4

Thread: Sending string from QT client to Java server

  1. #1
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Sending string from QT client to Java server

    I am trying to send a string from my QT client to a Java server. I am able to get them connected, verified both with the QT and Java programs. However, I am not able to send a string over the socket, nothing gets passed to the server. I tried using a QTextStream with no luck. Can anybody help?

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Sending string from QT client to Java server

    Some code ?
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Sending string from QT client to Java server

    Qt Code:
    1. QTcpSocket socket(this);
    2. socket.connectToHost(QHostAddress::LocalHost,50000,QIODevice::WriteOnly);
    3. socket.waitForConnected(1);
    4. //socket.write("sfsdfsadfsdf");
    5.  
    6. QTextStream out(&socket);
    7. out << "Some Text";
    To copy to clipboard, switch view to plain text mode 

  4. #4
    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: Sending string from QT client to Java server

    Isn't this a double thread?

Similar Threads

  1. Sending string from QT client to Java server
    By seanmu13 in forum Qt Programming
    Replies: 10
    Last Post: 3rd July 2007, 12:52
  2. qt network performance
    By criss in forum Qt Programming
    Replies: 16
    Last Post: 24th July 2006, 09:23
  3. synching client readings to server output
    By OnionRingOfDoom in forum Qt Programming
    Replies: 14
    Last Post: 28th January 2006, 18: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.