Function: process-datagram-address

process-datagram-address is a function defined in process.c.

Signature

(process-datagram-address PROCESS)

Documentation

Get the current datagram address associated with PROCESS.

If PROCESS is a non-blocking network process that hasn't been fully set up yet, this function will block until socket setup has completed.

Probably introduced at or before Emacs version 22.1.

Source Code

// Defined in /usr/src/emacs/src/process.c
{
  int channel;

  CHECK_PROCESS (process);

  if (NETCONN_P (process))
    wait_for_socket_fds (process, "process-datagram-address");

  if (!DATAGRAM_CONN_P (process))
    return Qnil;

  channel = XPROCESS (process)->infd;
  eassert (0 <= channel && channel < FD_SETSIZE);
  return conv_sockaddr_to_lisp (datagram_address[channel].sa,
				datagram_address[channel].len);
}