Changed timeout type to time_t
Fixed correct usage of timers
changed buffer type to unsigned char