Mock socket library for testing network applications