using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IpcLibrary.Core {
    /// <summary>
    /// 连接管理器接口
    /// </summary>
    public interface IConnectionManager {
        event EventHandler<ProcessInfo> ProcessConnected;
        event EventHandler<ProcessInfo> ProcessDisconnected;

        Task<bool> ConnectToProcessAsync(string processId, string address);
        Task DisconnectFromProcessAsync(string processId);
        Task<bool> SendMessageAsync(string targetProcessId, IPCMessage message);
        Task BroadcastMessageAsync(IPCMessage message);
        ProcessInfo GetProcessInfo(string processId);
        IReadOnlyList<ProcessInfo> GetAllProcesses();
    }
}
