• What is your GameDev Story?

Public Group

This topic is 4876 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Share on other sites
You can take a look at my Socket Layer for my custom MUD engine. It uses a basic TCP implementation, and works on both Unix and Windows (there are seperate definitions for the class for each). There are some portions on the basic raw socket reading, sending, and parsing.

To send an integer across the network, the following bit below should work. Mind you, I haven't tested this, and its just a guess. I'm also assuming that you're using C++ (for the reinterpret_cast) if not, you should be able to use a regular typecast to char*:
int i = 10;send( Socket, reinterpret_cast<char*> ( &i ), sizeof( int ), 0 );
The third sounds like that you do not have a int main() in your program. I haven't checked the website (actually need to run quick) so you should probably make sure there is not a WinMain. If there is, you can do the following to change the project to a Windows Application:

Right click on the name of the project in the Solution Explorer, and click Properties (or you should be able to access it through the project properties in the menus).

Go to the Linker folder, and then to the System tab. Change the Subsystem (first entry) from CONSOLE to WINDOWS. This will require WinMain instead of main() as the application's calling point.

This works in Visual C++ 7.1 .NET 2003; its what I have, but should be very similar for 7.0 .NET 2002.

Good Luck!

Share on other sites
Thanks very much for your anwser.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• Forum Statistics

• Total Topics
634135
• Total Posts
3015752
×