Exemplo n.º 1
0
        void handle(TcpClient client)
        {
            byte[] bytes = new byte[BUGGER_SIZE_LENGTH];
            Console.WriteLine("Polaczono");
            NetworkStream stream = client.GetStream();

            FileSender fileSender = serialization.readStream(stream);

            File.WriteAllBytes(fileSender.Name, fileSender.SerializedFile);
            Console.WriteLine("Plik pomyslnie skopiowiano");
            stream.Close();
            client.Close();
        }
Exemplo n.º 2
0
        void handle(TcpClient client)
        {
            byte[] bytes = new byte[BUGGER_SIZE_LENGTH];
            Console.WriteLine("Connected");
            NetworkStream stream = client.GetStream();

            FileSender fileSender = serialization.readStream(stream);

            File.WriteAllBytes(fileSender.Name, fileSender.SerializedFile);
            Console.WriteLine("File successfully copied");
            stream.Close();
            client.Close();
        }