Ethernet shield problems! Time to update library?

The fastest way to get these fixed would be if you can find the solution. For the problem of the connect() function returning 0 even though the connection succeeds, take a look at the Client::connect() code in ARDUINO/hardware/libraries/Ethernet/Client.cpp. The first question is which "return 0" is being called:

  if (!::connect(_sock, _ip, _port))
    return 0;

or:

  while (status() != SOCK_ESTABLISHED) {
    if (status() == SOCK_CLOSED)
      return 0;
  }

The second question is why. Maybe try adding a small delay between the call to connect() and the start of the while-loop? Or try looking for an intermediate status (SOCK_INIT) before starting that loop?

I'm not sure what to suggest for why the connection sometimes fails. It may be because when you reset the board, the connection is started from the same source port again. You could try editing Client::connect() to use a random _srcport.

Also, it appears that the disconnect (i.e. Client::stop()) sometimes fails. Here, it would be good to check the status() of the client after calling stop(). Be sure there's no data available().

Does that give you a place to start?