Thread: Send/receive at the same time problem

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    1

    Send/receive at the same time problem

    I'm making an telnet kind of client in C and have a little problem.
    Since I'm a half-newbie in networking I couldn't figure out how to receive data with a loop and in the same time have the ability to send.
    Pseudo code :

    while
    receive data
    print data
    end loop

    But I'd like to send data with the standart console input too ..
    I tried
    Pseudo code :
    while
    get input
    send input
    receive data
    end loop

    but then the program waits for the input before receiving ..
    I'd like to receive and send at the same time,without the receive depending on the input.
    I would appreciate ideas.Thanks.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    You mean, you want to print to stdin? I don't think you can do that.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    No. They mean they want unbuffered input. This is OS and compiler specific.

    Quzah.
    Hope is the first step on the road to disappointment.

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379
    Threads wont work with this sort of thing?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer problem... i think
    By fatdunky in forum C Programming
    Replies: 6
    Last Post: 11-30-2005, 03:45 PM
  2. another problem with catstr() this time
    By the_winky_files in forum C Programming
    Replies: 19
    Last Post: 09-22-2005, 04:20 PM
  3. time problem
    By sand_man in forum C Programming
    Replies: 9
    Last Post: 09-13-2005, 05:59 PM
  4. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  5. Problem with time on the board, or is it just me?
    By biosninja in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 10-23-2002, 05:45 AM