Instead of saving the characters as a string, and using atoi to convert the string to an integer, you can build up the number "on the fly".
int numFromPort;
void loop()
{
numFromPort = 0;
while(Serial.available() > 0)
{
char inChar = Serial.read();
if(inChar >= '0' && inChar <= '9')
{
numFromPort *= 10;
numFromPort += (inChar - '0');
}
}
// numFromPort now contains the data read from the port, as an integer
}
If the serial buffer contains '8', '3', '4', numFromPort will equal 0, 8, 80, 83, 830, and 834 at various times through loop.