Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Receiving Data while Typing  (Read 2447 times)

0 Members and 1 Guest are viewing this topic.

bluevideogame

  • Newbie
  • *
  • Posts: 4
    • View Profile
Receiving Data while Typing
« on: February 23, 2015, 07:47:40 am »
On the command line, how do I write the syntax for receiving data actively, while i am inputting text to the other client.
Because when I start typing in cin it won't receive the data until i press enter...

Thanks

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Receiving Data while Typing
« Reply #1 on: February 23, 2015, 07:52:55 am »
Either make the standard input non-blocking (OS specific) or use two threads.
Laurent Gomila - SFML developer

bluevideogame

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Receiving Data while Typing
« Reply #2 on: February 23, 2015, 11:24:32 am »
hmm, when i pass the socket into the thread function, i get running errors

Glocke

  • Sr. Member
  • ****
  • Posts: 289
  • Hobby Dev/GameDev
    • View Profile
Re: Receiving Data while Typing
« Reply #3 on: February 24, 2015, 03:34:20 pm »
hmm, when i pass the socket into the thread function, i get running errors
A minimal code example and some information about those errors might help to help you :)
Current project: Racod's Lair - Rogue-inspired Coop Action RPG

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Receiving Data while Typing
« Reply #4 on: February 24, 2015, 09:54:26 pm »
You are really *not* giving us anything to work with.
Post your code.
Post your error messages.
Post your description of what happens vs what you expect to happen.
Post info - we can't guess your problem from nothing..!

 

anything