how to generate multiple instances of my own server/process in erlang?
I wrote a server programe which is planed to use in multi player game. I should be generate multiple instances of my server for every client/player. but i cont able to generate. I took my server in 开发者_StackOverflowseparate module and I am calling the sever exported function from another module under a process for each client whenever the external aim to connect.
could any one give me some solution other than gen_tcp: server.............
I guess you need to re-think your architecture and identify layers in your system. The first would be connection - ok, it seems you got it. Then you want to present some logic to the user, moreover, you want to give him unique instance of that.. Just spawn it. If it is separate from the rest of the functionality it is going to be trivial. If I ware you, I would read one of Eralng/OTP books (Joe Amstrong, Thomson&Cesarini, Logan recently) to understand nature of Erlang systems and managing processes.
精彩评论