It is the port value of -1 that tells the driver to use named pipes network protocol. This is available on Windows only. The value is ignored if Unix socket is used.
This connection string (Named pipes alternative using MySqlConnection) can be used for connections to
Start over in the connection string reference index.
You can also get help in the Q&A forums where you can ask your own question.
The kb articles contains how-tos and instructions and you can search for anything if you're not sure were to look.