public void Process(Socket workerSock) { var remote = workerSock.RemoteEndPoint as IPEndPoint; Console.WriteLine("{0} want to download faces!", remote.Address.ToString()); DownloadFacesMsg m = new DownloadFacesMsg(); m.ReceiveFrom(workerSock); var files = Directory.GetFiles("Faces", "*.face"); foreach (var file in files) { if (m.FaceNameList != null) { var n = Path.GetFileNameWithoutExtension(file); if (m.FaceNameList.Contains(n)) { continue; } } FileMsg msg = new FileMsg(file, "server"); msg.Send(workerSock); } Console.WriteLine("{0} download faces OK!", remote.Address.ToString()); }
private void DownLoadFaces() { DownloadFacesMsg msg = new DownloadFacesMsg("Faces"); msg.Send(serverSock); }