Fixed session type verification.
Changed the timeout of reading and connection.
Added thread number variable.
First version of functional sync with threads.