Ok, so I've been testing this a bit more and here are the most recent results:
All of the expectable situations produced an error window,
except when the given name can't be resolved by DNS. On my previous post, I was actually waiting for too little time for some of the other tests to fail.
If I input something like "asd", the DNS server responds with "No such name". amulegui will not send any TCP packets from then on and nothing happens anymore. amulegui just sits running in the background - I started it from a terminal, so I'm sure it is still running, just waiting for something (possibly for the connection to timeout - but it didn't even try to start such connection, as the name resolution failed).
I've been sitting here in front of Wireshark for about 20 minutes now and nothing happened after the attempt to resolve "asd".
The rest of the tests I made led me to the conclusion that if the given name can be resolved, or an IP (reachable or not) is provided, amulegui will send TCP packets, trying to establish the connection. After this has started, if no answer is received after approximately 3 minutes and 30 seconds (on my machine), a window with the error message appears.
Outside world tests:
name that can be resolved (google.com) -> times out after 3m30s
address without amule running (213.13.146.140) -> times out after 3m30s
Local network:
address with machine turned off (192.168.2.176) -> times out after 3m30s
resolvable name without aMule running (C-7) -> times out after 3m30s
address without aMule running (192.168.2.148) -> times out after 3m30s
All of these tests make TCP packets get out of my machine. After trying for ~3m30s without any response, the error window appears.
So, I'd suggest adding a timeout for these attempts. Even if a machine is reachable, if, say, after 30 seconds there is no response, it should be reasonable to at least tell the user that the connection is not available (or, at least, warn him that it is very likely to fail or have errors).
Also, hiding any window from the user gives a bit of a "loss" sensation. Between the moment you click "OK" and you have any subsequent visual input, you don't know if something went wrong or if there will be any more output. I'm thinking that a window displaying "Establishing Connection..." with a possible "Cancel" button would be nice for this.
Now that I think of it, all of this could be combined into something like:
First, the current window where the user inputs the IP/address + port + password is displayed.
- after clicking OK, that window wouldn't vanish, but the input boxes would be greyed and a message saying "Establishing Connection..." would appear on the same window (perhaps in something resembling a status message), with some kind of visual input (a jumping rabbit comes to mind

. An "Abort Attempt" button would be nice at this stage too.
- if after 30 seconds the connection is not established yet, a warning would be displayed in the same window, telling the user that this attempt might fail.
- if after 10 minutes the connection is not established yet OR the connection times out, abort the attempt and show the warning and _unlock_ the user input at the login window.
This would make the login process more intuitive and would not let the user be left asking "What's happening now? Did it crash? Should I just wait? Should I launch another amulegui instance?"
I could also very well try to program this and submit a patch... Maybe when I have the time (*laughs dementedly*) I can try to do this...
I'm using amule 2.2.5 using the Debian packages at the official testing repositories.
Egh... I just noticed that this post grew immensely by itself... I hope you can reproduce this and consider my suggestions.