Multiplayer socket programming, Windows/Mac compatible

Moderator
Posts: 371
Joined: 2006.08
Post: #1
Hello again Smile
I finally got texture mapping working in pong, but now I have another problem. Well, it's not really so much of a programming as needing advice and a pointer in the right direction.
I need to have multiple clients connecting to a server, which accesses a database, executes code, and returns information to a client that requested it.
I have been told by a friend of mine that I should look into socket programming, so I did. Now I need some server code that works on either the mac or the windows platform, considering that I do not have a Linux platform computer to test a server application on. Does anyone have some code (or know of a place that I could get code) for a very, very basic client program that would work on the mac and a server program that would accept the client program that was also working on a mac?

thanks Smile

-wyrmmage
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Quote this message in a reply
Oldtimer
Posts: 834
Joined: 2002.09
Post: #3
In all cases, RakNet is everyone's daddy. A licence is $100 if you go commercial, which is next to free when you consider what it gives you. Smile
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #4
This is a pretty good page. The Windows implementation of sockets is nearly identical except for a few points. You can look at this page to see those few differences.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #5
Porting windows socket code to mac requires a good bit of work actually, the API's are definitly not identical.
Windows just ripped of the BSD socket API and mashed it into what event handling stuff it already had.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Moderator
Posts: 371
Joined: 2006.08
Post: #6
hmmm....sounds like I'm getting some conflicting mesages. I really don't have any money to shell out to buy software (I'm 15 >.<), which is one reason why I hard-code everything. Thanks for the links to the websites Smile
One more thing: Would it be simpler to build my server application as a Mac or a Windows application? (It needs to be able to handle both mac and windows requests, even if that does mean seperate coding for each).

Thank again,
-wyrmmage
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
I really doubt it makes much difference. The socket code might not be quite identical, but it should be pretty close. When I was doing cross-platform socket stuff a few years ago we only had one implementation for all 3 platforms, and a few #defines and typedefs to handle the differences. Either way, you won't need to know what OS your client is running.
Quote this message in a reply
Post Reply