Jump to content
  • Advertisement
Sign in to follow this  
BigBeginner

Server/client on ONE machine (DirectPlay8) or what am i doing wrong?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Im trying to make an simple server/client program. I dont have network, just one machine, so I have to test my programs on 1 machine. Question is: is it possible? Possible make one (or more) servers on one machine, enumerating these, connect to this (these?). If yes, here some code. Its delphi, but I think the C++ coders can understand it. The INIT steps: =============== DirectPlay8Create (IID_IDirectPlay8Peer, DPeer, nil); DPeer.Initialize (nil, MessageHandler, 0); DirectPlay8Create (IID_IDirectPlay8Address, DAddress[0], nil); DAddress.SetSP (@CLSID_DP8SP_TCPIP); Server making: ============== DirectPlay8Create (IID_IDirectPlay8Server, DServer, nil); DServer.Initialize (nil, MessageHandler, 0); FillChar (Desc, SizeOf(Desc), 0); Desc.dwSize:= SizeOf(Desc); Desc.dwFlags:= DPNSESSION_CLIENT_SERVER; Desc.guidApplication:= InitedRec.MyGUID; Desc.pwszSessionName:= 'blahblahblah'; DServer.Host (Desc, DAddress, 1, nil, nil, nil, 0); Enumerating available servers on localhost: =========================================== FillChar (Desc, SizeOf(Desc), 0); Desc.dwSize:= SizeOf(Desc); Desc.guidApplication:= InitedRec.MyGUID; Res:= DPeer.EnumHosts (Desc, nil, DAddress, nil, 0, 4, 0, 0, nil, nil, DPNENUMHOSTS_SYNC); ------------------------------------------------- These all works, but there is an interesting thing: my callback funtion, the "MessageHandler" (I gave it at initialization) never run. And that's all questions :) (Dont laugh at me about my bad English...)

Share this post


Link to post
Share on other sites
Advertisement
Sample DirectPlay8Peer code can be found here:

http://pages.infinit.net/cbenoi1/netpong.zip
http://pages.infinit.net/cbenoi1/r_1_5_0.zip

-cb

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!