supermemo / SuperMemoAssistant

A companion app for SuperMemo 17-18 which extends its functionalities through plugins.
https://www.supermemo.wiki/sma/
MIT License
199 stars 21 forks source link

Remoting IPC issues #24

Open alexis- opened 4 years ago

alexis- commented 4 years ago

Plugins sometime won't reconnect.

System.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: The system cannot find the file specified.

Server stack trace: 
   at System.Runtime.Remoting.Channels.Ipc.IpcPort.Connect(String portName, Boolean secure, TokenImpersonationLevel impersonationLevel, Int32 timeout)
   at System.Runtime.Remoting.Channels.Ipc.ConnectionCache.GetConnection(String portName, Boolean secure, TokenImpersonationLevel level, Int32 timeout)
   at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at void System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at void System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(ref MessageData msgData, int type)
   at ISuperMemo SuperMemoAssistant.Interop.SuperMemo.ISuperMemoAssistant.get_SM()
   at void SuperMemoAssistant.Services.IO.Keyboard.KeyboardHookService.OnSMAAvailable(ISuperMemoAssistant sma) in D:/Work/IT/Prog/SuperMemo/SuperMemoAssistant.master/src/Core/SuperMemoAssistant.Interop/Services/IO/Keyboard/KeyboardHook.cs:line 246
   at void SuperMemoAssistant.Services.Svc.set_SMA(ISuperMemoAssistant value) in D:/Work/IT/Prog/SuperMemo/SuperMemoAssistant.master/src/Core/SuperMemoAssistant.Interop/Services/Svc.cs:line 57
   at void SuperMemoAssistant.Interop.Plugins.SMAPluginBase<TPlugin>.OnInjected() in D:/Work/IT/Prog/SuperMemo/SuperMemoAssistant.master/src/Core/SuperMemoAssistant.Interop/Interop/Plugins/SMAPluginBase.cs:line 188
2020-01-16 23:02:34.869 +01:00 [ERR] Exception occurred in 'Void OnInjected()'. 
System.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: The system cannot find the file specified.
alexis- commented 4 years ago

Creating a new IPC server for every plugin would lead to threading issues.