Yes, this can be done without a router, switch or other hardware, but you still must use a network. You can only send messages by IP address on an IP network. (IPv4 or IPv6) this is a software layer that is already written that allows for a programmer to do things like open a socket.
You are able to create an IP network using WiFi on an ESP 8266 or 32 using the WiFi library. A password is not a requirement, but SSID is.
One ESP will be setup as an access point to broadcast the SSID and the other will connect to the network using the SSID. Then you can open sockets and send data back and forth freely.
Technically, if you wanted to, you could make your own RF interface that just broadcast a signal with a device identifying id that looks like an IP address and all yor RF devices that don't have that id drop the data, but this seems like a lot of work to get this functionality and it would be far inferior to an IP network.
I don't think anyone thinks you are crazy, they just don't know exactly what information you are missing to understand what you need to do to successfully complete your project.
barryjo:
...I am not trying to make a network, only a simple connection between two devices. Given this situation, I cannot see why a network name and password are required. I don't even know how they would be used. I can see that each phone can be set to listen on a particular IP address and port. If I know the IP/port of the other phone, and the other phone is set to listen, then it seems to me that all I need to do is to send to the proper IP/port and get heard by the other phone. I would probably set each phone to listen on a particular IP/port. If I need to use a network name and password, how would I use it?
I think that what I am talking about is simply opening a socket on each phone and listening for another phone to send to their IP.
Again, to be clear here, the password part is optional. The name is so devices know what access point they are connecting to.
If you don't connect your two devices together (in a network, though the simplest form of a network [one device connected to another with a wire or wireless connection]) how are the data signals / radio waves going to be sent out of your device to be read by another device listening on that IP / port?
The WiFi network connection will handle all the RF data sending for you so that all you need to do is open a socket.