2013-01-11

I haven't done much network programming lately so I decided to make a small program. I quickly made this small program within 2 days, it uses .net's TcpClient and TcpListener classes.

All the program does is transfer files to/from computers. Server mode of the program accepts files, while client mode of the program sends files.

I would like any experienced (networking) programmers to tell me what I should improve on.

Looking at the code now I would:

1. try and somehow make reading the file and uploading the file happen on different threads (which will probably make the transfer faster). Same with downloading/saving the file.

2. split the code up a bit mode, its mostly crammed into one method - how would I do this though?

Here are the 4 classes used in the program:

Program.cs...

ArrayHelper.cs...

Client.cs...

Server.cs...

Ok, that ended up longer than I thought.

All replies are appriciated.

Thanks,

Xanather.

Show more