Server/client on ONE machine (DirectPlay8) or what am i doing wrong?
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...)
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
http://pages.infinit.net/cbenoi1/netpong.zip
http://pages.infinit.net/cbenoi1/r_1_5_0.zip
-cb
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement