Introduction
============
ShareNet is a centralized P2P-based meultimedia file sharing application for the LAN that follows a client-server approach. The server monitors each client on the network and all the files shared between them (using a MySQL database). Currently supported file formats are: mp3, wma, wav, avi, mpg, mpeg, wmv, mov, mp4, divx.

ShareNet was created as a major project in the final semester of college by 2 students pursuing their B.Tech degree in Computer Science and Engineering. ShareNet was created with a view of satisfying the huge network sharing demands (primarily multimedia files) in college hostels in a more fast and efficient manner, though it can be used in almost any kind of situation.

Due to lack of time, the developers were not able to fully implement all the intended features, primarily:
- multithreaded file downloading (to make downloading fast)
- automatic database handling (to manage the database more effectively and efficiently)

Technologies and libraries used
===============================
Java (JDK 1.6) was used to create the programs and MySQL (5.1) as the backend database.

Requires these libraries in the classpath:
- myid3.jar (http://www.fightingquaker.com/myid3/)
- jakarta-regexp-1.5.jar (http://jakarta.apache.org/regexp/)
- fast-md5.jar (http://www.twmacinta.com/myjava/fast_md5.php)

Using ShareNet
==============
- First, create a MySQL database with structure same as that mentioned in the file "p2pdb.sql". The suggested way is to directly import "p2pdb.sql" into a MySQL database created for ShareNet; the easiest way to do so would be to use a tool like phpMyAdmin. Modify the file "p2p_config.txt" to reflect the newly created database information.
- When the db is setup, execute "P2PServer.jar" through command-line. This will initiate a server process that starts listening on port 4321.
- Next, execute "P2PClient.jar", either by double-clicking on it or through command-line. Alternatively, just double-click on the file sharenet_client.exe. This will bring up the GUI client application.
- Configure the client by going to Edit > Options.
- Similarly, open the client application on some other PC on the same network.
- Finally, share your favorite media files between PCs.

Using the sharenet_client_setup.exe installer
=============================================
The server process for ShareNet has to be always started using the file P2PServer.jar, but to bring up the client interface (GUI) of ShareNet, you have 3 options:
- Execute "P2PClient.jar"
- Execute "sharenet_client.exe"
- (simplest) Install the client application using "sharenet_client_setup.exe"

NOTES
=====
- The server part of ShareNet is a command-line based application whereas the client part is a graphical (GUI) app.
- ShareNet server and client applications can run simultaneously on the same PC or two different PCs.
- You can have multiple clients running, on different PCs, but only one instance of server on a network.
- ShareNet works only on a LAN network. It was tested thoroughly on directly connected PCs and on a star topology (all PCs connected to switches).
- Files are downloaded by one client directly from another client. There is no role of server in file sharing.
- ShareNet works on Windows XP/Vista and Linux.


--------------------------------------------
Anurag Bhandari
Gagandeep Singh Walia

National Institute of Technology, Jalandhar
2009