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

Author Topic: TCP and Graphics in one Single Thread  (Read 1818 times)

0 Members and 1 Guest are viewing this topic.

Setepenre

  • Newbie
  • *
  • Posts: 2
    • View Profile
TCP and Graphics in one Single Thread
« on: August 28, 2015, 08:12:57 pm »
I think I found something weird about SFML network handling. Here is my stack overflow post http://stackoverflow.com/questions/32260637/sfml-tcp-socket-bidirectional-communication

Summary:

- Simple Sever/Client, One thread.
- Client sends data to server once then the client is unable to receive more data from the server (it thinks it is disconnected, but it can send data) while the server is still receiving and sending data to the client correctly.

Solution I found:
- remove the client window (graphics, events)
- move the network specific into another thread (detached, with its own loop)

I was wondering if I could make the single thread program work with graphics.
did I missed something ?

Thanks

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: TCP and Graphics in one Single Thread
« Reply #1 on: August 28, 2015, 09:16:48 pm »
This is not easy to investigate. Could you create a complet and minimal example that reproduces the problem?
Laurent Gomila - SFML developer

Setepenre

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: TCP and Graphics in one Single Thread
« Reply #2 on: August 29, 2015, 04:46:52 pm »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: TCP and Graphics in one Single Thread
« Reply #3 on: August 29, 2015, 06:03:34 pm »
This is not complete nor minimal.

http://sscce.org/
Laurent Gomila - SFML developer

 

anything