Fixed the buffer problem! Now to manage the connection and threads.