What kind of tools do you mean? If you want to use java you should create binary stream and pass data any way you want to.
You can use any of existing protocols or create your own - passing size of followed file, passing special sequence as end of file or something else.
As for code examples - use google or magic "Search Forums" function at the left side of this page.
right now my protocol is using two different ports
one port is my management protocol over udp
the other is for regular messages over tcp,.
for the file transfer i want to use a third port so that everything will work in parallel so i can use any protocol doesn't matter what i've been using so far.
> but at any time my client can receive some command on
> udp or some message on tcp or some file, so he needs
> to listen to all stuff and receive and send in
> parallel.
This can be done using only one port if you implement multiplexing. And I personally think that server will be much simpler if you use multiplexing streams in same socket instead of multiple sockets
I like the chunks idear becouse you can use chunks to send different content in the same stream if you add some sort of metadata inside the chunk. This will allow to upload multiple files same time. And even resuming broken transfers