Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Network
»
Dont get all data - UDP and TCP
Print
Pages: [
1
]
Author
Topic: Dont get all data - UDP and TCP (Read 3548 times)
0 Members and 1 Guest are viewing this topic.
raXor
Newbie
Posts: 7
Dont get all data - UDP and TCP
«
on:
December 11, 2009, 07:24:43 pm »
Hi, I have a big problem in a network program.
I have written a simple chat. The problem is that I dont receive all data. I get only the first 4 characters of the sending string.
I have testet all possibilites with different sockets (UDP/TCP), threads etc.
Heres my actually Code (in UDP):
http://codepaste.net/tyokzh
The hole project is here:
http://www.uwe-collmer.de/Netzwerk.rar
I hope someone can help me...
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Dont get all data - UDP and TCP
«
Reply #1 on:
December 11, 2009, 07:48:07 pm »
Hi
sizeof(sText.c_str()) gives you the size in memory of a const char*, which is 4 bytes on your machine. What you want is sText.size().
Logged
Laurent Gomila - SFML developer
raXor
Newbie
Posts: 7
Dont get all data - UDP and TCP
«
Reply #2 on:
December 11, 2009, 11:25:52 pm »
Oh... damn mistake.
Thank you very much Laurent!
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Network
»
Dont get all data - UDP and TCP
anything