Modified hub.c for socket