Can I run a Sockets program on a Windows machine that's not connected to a network?

Brian O'Byrne

Yes, as long as TCP/IP is installed on the machine in some way.

If you have TCP/IP installed on any interface, e.g. the local loopback interface or a dialup interface, you can expect all socket operations to succeed as long as you are communicating only with yourself. You may use "localhost" as the hostname or as the IP address.

If you do not have any TCP/IP networking installed, you can expect socket operations to throw exceptions such as BindException, ConnectException, ProtocolException, SocketException, etc.