internal Message(Node to, string content) { Id = Guid.NewGuid().ToString(); To = to.GUID.ToString(); From = "anonymous"; Content = content; TTL = 255; }
internal Message(Node to, Node from, string content) { Id = Guid.NewGuid().ToString(); To = to.GUID.ToString(); From = from.GUID.ToString(); TTL = 255; Content = content; }
public QuickLinkService() { ReceivedMessages = new List<Message>(); local = new Node(); local.MessageReceived += Local_MessageReceived; service = new Service(local); service.FoundAddress += Service_FoundAddress; service.FoundServer += Service_FoundServer; service.LostServer += Service_LostServer; }
/* ==== CONSTRUCTORS ===== */ internal Service(Node _local, ServiceType _type = ServiceType.Full) { Type = _type; _local.Local = true; Nodes = new List<Node> { _local }; Connections = new List<ServiceConnection>(); Thread thread = new Thread(ReconnectServers); thread.Start(); }
private void AnnounceOneNodeToServer(Node node, ServiceConnection service) { service.Send(node.ToString()); }
private void AnnounceOneNodeToAllServers(Node node) { foreach (ServiceConnection connection in Connections.Where(i => i.Client.Connected)) { connection.Send(node.ToString()); } }
internal string MakeNode() { var node = new Node(); node.Local = true; Nodes.Add(node); return node.GUID.ToString(); }