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

Author Topic: Not sure if noob question... Or real problem  (Read 2124 times)

0 Members and 1 Guest are viewing this topic.

Tytan

  • Newbie
  • *
  • Posts: 12
    • View Profile
Not sure if noob question... Or real problem
« on: June 03, 2017, 08:20:18 am »
(Sorry for the no-info-title lol.)

Hi! I have a server, and a client program, bothcompile and connect to each other fine, I can connect multiple users and all the good stuff...
But when I try to send data to the server from one of the clients, I need to put 10 characters infront of the message I want to send, otherwise the data is corrupt.
Does anyone know the cause of this madness?

Client (Only posted main loop)
(click to show/hide)

Server (only posted mian loop)
(click to show/hide)

All information will be useful :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Not sure if noob question... Or real problem
« Reply #1 on: June 03, 2017, 08:40:39 am »
Replace sizeof(input) with input.size().
Laurent Gomila - SFML developer