Hi Liviu,
the reason for such delays when you have no real network connection is often a problem with DNS name resolution. Is it possible that your application tries to resolve any hostname besides "localhost"? This is the most obvious problem that comes to mind. Looking up the IP address for "localhost" is usually no problem because there should be a fixed entry in the local hosts file (which exists on both linux and windows systems).
That said
you should check if your "hosts" file contains a correct entry for "localhost" and that your application doesn't try to resolve any other hostnames which would most probably require a network connection to a DNS server.
Marco