Results 1 to 2 of 2

Thread: read and write on qtcpsocket

  1. #1
    Join Date
    May 2009
    Posts
    38
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default read and write on qtcpsocket

    My question is :

    is that possible to do the write and read operation on same socket?
    are them going to conflict each other?

    how to do it?

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    866
    Thanks
    69
    Thanked 58 Times in 56 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: read and write on qtcpsocket

    Hi,

    Yes, it is possible and there will be not conflicts.
    You can use QDataStream, QTextStream or QIODevice::read and QIODevice::write. It depends on how the data will be sent.
    Also you have to connect the "readyRead" SIGNAL of the socket to receive the data.
    Take a look at Qt network examples.
    Òscar Llarch i Galán

  3. The following user says thank you to ^NyAw^ for this useful post:

    dognzhe (4th June 2009)

Similar Threads

  1. How can I Read Write Excel File
    By xingshaoyong in forum Qt Programming
    Replies: 6
    Last Post: 13th July 2011, 20:16
  2. How to read and write line by line?
    By Alex Snet in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2010, 15:49
  3. QTcpSocket waiting for write to be read
    By spraff in forum Qt Programming
    Replies: 1
    Last Post: 23rd December 2008, 19:12
  4. [Java] read and write a file
    By mickey in forum General Programming
    Replies: 3
    Last Post: 22nd June 2008, 10:43
  5. How to open a file in Read Write mode
    By merry in forum Qt Programming
    Replies: 13
    Last Post: 16th November 2007, 14:40

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.