This function will flush the buffer's data, which means that all data remaining in the buffer will be scheduled for sending.