Skip to content

Server stops receiving client messages after an exception occurs #36

Open
@jaimestuardo

Description

@jaimestuardo

Hello,

I am using this code to receive messages from pipe clients:

      _pipeServer = new NamedPipeServer<CommandServer.Ipc.Message>(CommandServer.Command.PipeServerName);
      _pipeServer.ClientConnected += delegate (NamedPipeConnection<CommandServer.Ipc.Message, CommandServer.Ipc.Message> connection)
      {
          ////
      };
      _pipeServer.ClientDisconnected += delegate (NamedPipeConnection<CommandServer.Ipc.Message, CommandServer.Ipc.Message> connection)
      {
          ////
      };
      _pipeServer.Error += delegate (Exception exception)
      {
          ////
      };
      _pipeServer.ClientMessage += delegate (NamedPipeConnection<CommandServer.Ipc.Message, CommandServer.Ipc.Message> connection, CommandServer.Ipc.Message message)
      {
         ////
      };

Almost all works perfectly. _pipeServer.ClientMessage continues receiving messages from clients, however, when inside ClientMessage an exception occurs and the _pipeServer.Error event is called, server stops receiving client messages.

I tried calling _pipeServer.Start(); again in the Error event, but it did not work.

If I close the server application and start it again, it starts receiving client messages again.

Any help, please?

Thanks
Jaime

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions