code: func (s *Socket) write(rawData string) {
  	// Write to the stream and check if the buffer is full.
  	select {
  	case <-s.isClosedChan:
  		// Just return because the socket is closed.
  		return
  	case s.writeChan <- rawData:
  	default:
  		// The buffer if full. No data was send.
  		// Send a ping. If no pong is received within
  		// the timeout, the socket is closed.
  		s.sendPing()
  
  		// Now write the current data to the socket.
  		// This will block if the buffer is still full.
  		s.writeChan <- rawData
  	}
  }
docs: //##############################//
  //### Private Socket methods ###//
  //##############################//