Results 1 to 4 of 4

Thread: qt TCP socket

  1. #1
    Join Date
    Oct 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Question qt TCP socket

    i want to read a data(text) directly from a incoming socket and writes to another outgoing socket using TCPServer.
    please provide me a help on this.

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    17
    Thanked 90 Times in 88 Posts

    Default Re: qt TCP socket

    One example, using the same sockect can be found just a few messages below yours:

    http://doc.trolltech.com/solutions/4...le-server.html

    The HTTPServer reads the GET Request, and answers to the socket with some HTML-code.

    If you want to send data to an other socket you need to open a second socket. Do you have your other socket setup already? A place to start would maybe be the servers protected incomingConnection function.

    HIH

    Johannes
    Last edited by JohannesMunk; 28th October 2009 at 12:24.

  3. #3
    Join Date
    Sep 2009
    Posts
    39
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    3

    Arrow Re: qt TCP socket

    Hi ketan, Im new to Qt TCP sockets programming. So i need to write a program for sockets in Qt to transfer packets of data. I need to know in which way it is done. If possible plz post a sample code how to send data to another IP address PC in a Network. I want to learn it quickly so can you assist me. How to do it. Plz paster sample code how it can be done, just by entering remote IP address, An connection should be established.

    Thanks in Advance.

  4. #4
    Join Date
    Oct 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows

    Arrow Re: qt TCP socket

    hi..
    if u want to send data packets across network use the ip address of reciver in connecttohost() mtd and have a defined port no for the two.
    lets see this will solve ur prob or not..

Similar Threads

  1. socket notifiers cannot be enabled from another thread
    By babu198649 in forum Qt Programming
    Replies: 5
    Last Post: 4th April 2009, 16:15
  2. Greenphone mini USB socket problem
    By izico in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 25th September 2007, 12:59
  3. Socket bind error
    By rburge in forum Qt Programming
    Replies: 1
    Last Post: 21st September 2007, 01:18
  4. How to write on a socket in another thread?
    By Valheru in forum Qt Programming
    Replies: 7
    Last Post: 12th October 2006, 11:52
  5. qt socket question
    By bluesguy82 in forum Qt Programming
    Replies: 4
    Last Post: 29th August 2006, 16:42

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
  •  
Qt is a trademark of The Qt Company.