Design and Implementation of a Generic Library for P2P Streaming