G
G
Georgy Pelageykin2018-03-04 17:48:35
.NET
Georgy Pelageykin, 2018-03-04 17:48:35

Is it possible to use actors in the actor model both on the client and on the server (Akka .NET)?

Studying the concept of actors, trying to create a client-server game. I started with organizing the connection / disconnection of players.
For me, at the moment, the possibility of transparently sending messages between server actors and client actors looks very attractive, allowing both the client and the server to be implemented within the same paradigm and remoting technology.
The client has a ServerConnectionActor . To connect, it sends a ConnectionRequest to the server, which has the following structure:

  • PlayersManagerActor , to which this request comes from outside from the client.
  • On request, it creates a child PlayerActor that will communicate with this client. The client sends a response with IActorRef to this child actor.

Thus, once a connection is established, there is a client-side actor and a server-side actor that exchange messages.
The question is, is this a security risk? For example, a client actor can send some system message to the PlayersManager, such as PoisonPill, which will cause the server to be unavailable.
Is this a fundamentally wrong approach or is the option viable after some refinement (closing other actors from receiving messages from the external network, etc.)?
I use Akka.NET and Unity3d, but the question is rather conceptual and applies to akka in general.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Georgy Pelageikin, 2018-03-07
@ArXen42

I think there is no point in expecting an answer further, incl. I will answer myself with what I managed to google (in general, the question could have been deleted, everything is in the documentation, but maybe it will come in handy for someone):

  1. In any case, the server ActorSystem must be closed for outside access.
  2. Connecting to it directly is bad practice , you can't use IActorRef to interact with an insecure client.
  3. Accordingly, as a solution, it is proposed to use Akka.IO or any other more controlled and secure way of network interaction with the client.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question