How to refesh available() ?

Hello, i need to create a function to my arduino uno , who can check a connection my wire to pin. The function .available() is ok, but there is one small problem. When the wire isn't connect to pin, function available return 0, when i connect wire to pin, available() next return 79... but ! when i again disconnect a wire from pin, available retun also 79, but no 0... why? problem with no refeshing? with buffer? help , thanks friends;)

The function .available() is ok,

There is no available() function. Several classes have an available() method. We can't possibly help you without knowing what class you are talking about.

In general, though, the available() methods report how much data has been buffered for you to read. You can't force more data to be available, so talk of refreshing available() are useless.

I need to create a sketch in order to check connection wire to pin. I have a connect wire to pin number 8 and 9 . I need to get report, when i disconnect a wire from pin, and report when i connect wire to pins.

I have a sketch, and i need to get alert when a wire are disconnected and afterward, a alert when i again connect a wires to pins.

I have a sketch, and i need to get alert when a wire are disconnected and afterward, a alert when i again connect a wires to pins.

That won't happen. The Arduino can not tell if anything is connected to a pin. When you write the sketch, you are supposed to write it to deal with what will be connected when the sketch runs. Then, before you run the sketch, you are supposed to make sure everything is connected.

If there's characters available in the buffer, you must read them to empty the buffer. Then available() will return zero. Wait a few milliseconds and then see if any more characters have arrived.