Sending ints?
Can anyone tell me how to send integers across the net? The send function doesn't support them unless I do (char*)&myInt, and converting them back is a mess that I'd like to get away from. Aren't there any other function I can use? I've tried to look, but send seems to be the only one there is:(
_______________________Afr0Games
That's how you do it.
If you think reading and writing raw data is hard, you might want to look into a wrapper such as OpenTNL or RakNet which have classes that can marshal for you.
If you think reading and writing raw data is hard, you might want to look into a wrapper such as OpenTNL or RakNet which have classes that can marshal for you.
enum Bool { True, False, FileNotFound };
But hold on... does that mean that I simply cannot send numbers across the net? That's... horrible! I mean... strings are much less fast than ints and floats, right?
_______________________Afr0Games
Quote:
Original post by Afr0m@n
But hold on... does that mean that I simply cannot send numbers across the net? That's... horrible! I mean... strings are much less fast than ints and floats, right?
its just a bit man, a bit that represents a char is == to a bit that represents and int. :)
"Let Us Now Try Liberty"-- Frederick Bastiat
(char*)&theInt,sizeof(theInt) is how you do it. That doesn't mean you're sending it as text. There are links, and even a description of this thing, in the Forum FAQ.
enum Bool { True, False, FileNotFound };
Ok thanks:)
I managed to develop a solution in Blitz Basic that enabled me to pivk up the data:)
I can't believe that I'm actually building my own MMORPG lol! :D
I managed to develop a solution in Blitz Basic that enabled me to pivk up the data:)
I can't believe that I'm actually building my own MMORPG lol! :D
_______________________Afr0Games
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement