data structure alignment.
@end itemize
-@item :nowait @var{bool}
-If @var{bool} is non-@code{nil} for a stream connection, return
+@item :nowait @var{nowait}
+If @var{nowait} is non-@code{nil} for a stream connection, return
without waiting for the connection to complete. When the connection
succeeds or fails, Emacs will call the sentinel function, with a
second argument matching @code{"open"} (if successful) or
@code{make-network-process} does not return until the connection
has succeeded or failed.
+If @var{nowait} is @code{dns}, also do the @acronym{DNS} lookup
+asynchronously, if supported. In that case, the process is returned
+before a connection has been made, and the client should not try
+communicating with the process until it has changed status to
+@code{"connected"}.
+
@item :tls-parameters
When opening a TLS connection, this should be where the first element
is the TLS type (which should either be @code{gnutls-x509pki} or
:nogreeting is a boolean that can be used to inhibit waiting for
a greeting from the server.
-:nowait is a boolean that says the connection should be made
-asynchronously, if possible.
+:nowait, if non-nil, says the connection should be made
+asynchronously, if possible. If it is `dns', also do the DNS
+lookup asynchronously, if supported. In that case, the process
+is returned before a connection has been made, and the client
+should not try communicating with the process until it has
+changed status to \"connected\".
:tls-parameters is a list that should be supplied if you're
opening a TLS connection. The first element is the TLS
is a cons (DECODING . ENCODING), DECODING is used for reading, and
ENCODING is used for writing.
-:nowait BOOL -- If BOOL is non-nil for a stream type client process,
-return without waiting for the connection to complete; instead, the
-sentinel function will be called with second arg matching "open" (if
-successful) or "failed" when the connect completes. Default is to use
-a blocking connect (i.e. wait) for stream type connections.
+:nowait NOWAIT -- If NOWAIT is non-nil for a stream type client
+process, return without waiting for the connection to complete;
+instead, the sentinel function will be called with second arg matching
+"open" (if successful) or "failed" when the connect completes.
+Default is to use a blocking connect (i.e. wait) for stream type
+connections. If NOWAIT is `dns', also do the DNS lookup
+asynchronously, if supported. In that case, the process is returned
+before a connection has been made, and the client should not try
+communicating with the process until it has changed status to
+"connected".
:noquery BOOL -- Query the user unless BOOL is non-nil, and process is
running when Emacs is exited.
#endif
#ifdef HAVE_GETADDRINFO_A
- if (!NILP (Fplist_get (contact, QCnowait)) &&
+ if (EQ (Fplist_get (contact, QCnowait), Qdns) &&
!NILP (host))
{
int ret;
return Qnil;
/* This process should not already be connected (or killed). */
- if (p->infd != 0)
+ if (!EQ (p->status, Qconnect))
return Qnil;
ret = gai_error (p->dns_requests[0]);
DEFSYM (QCcoding, ":coding");
DEFSYM (QCserver, ":server");
DEFSYM (QCnowait, ":nowait");
+ DEFSYM (Qdns, "dns");
DEFSYM (QCsentinel, ":sentinel");
DEFSYM (QCtls_parameters, ":tls-parameters");
DEFSYM (QClog, ":log");