IRPCClientTransport.cs 942 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using InABox.Clients;
  3. using InABox.Core;
  4. namespace InABox.Rpc
  5. {
  6. public interface IRpcClientTransport : IRpcTransport
  7. {
  8. bool Ping();
  9. DatabaseInfo Info();
  10. /// <summary>
  11. /// Connect to remote server.
  12. /// </summary>
  13. /// <returns><see langword="true"/> if connection success, <see langword="false"/> otherwise.</returns>
  14. bool Connect();
  15. void Send(RpcMessage message);
  16. TResult Send<TCommand, TParameters, TResult>(TParameters parameters)
  17. where TCommand : IRpcCommand<TParameters,TResult>
  18. where TParameters : IRpcCommandParameters, ISerializeBinary
  19. where TResult : IRpcCommandResult, ISerializeBinary, new();
  20. void Disconnect();
  21. event RpcTransportMessageEvent OnMessage;
  22. bool IsConnected();
  23. bool IsSecure();
  24. string? ServerName();
  25. }
  26. }