private void handleJoin() { byte[] target = buff.Skip(1).Take(1).ToArray(); int targetGUID = target[0]; byte[] data = buff.Skip(2).ToArray(); PeerInfo pInfo = UDPResponder.ByteArrayToPeerInfo(data); Console.WriteLine("Received a join to table request from {0}", pInfo.getGUID); //add the pInfo with event receiveRequestJoin(targetGUID, pInfo); }
private void handleClosest() { byte[] data = buff.Skip(2).ToArray(); byte[] channelGUID = buff.Skip(1).Take(1).ToArray(); PeerInfo pInfo = UDPResponder.ByteArrayToPeerInfo(data); int targetGUID = (int)channelGUID[0]; Console.WriteLine("Received a responsse for closest to {0}, with GUID: {1}", targetGUID, pInfo.getGUID); //get the corresponding channel receiveClosest(targetGUID, pInfo); }