[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Local interface used for outbound network connections
From: |
Kim F. Storm |
Subject: |
Re: Local interface used for outbound network connections |
Date: |
08 Jan 2003 17:39:18 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Mario Lang <address@hidden> writes:
> > I definitely intended make-network-process to make this info
> > available, but I forgot to implement it. Thanks for reminding me :-)
> >
> Thanks a lot! Tested, and works here.
Good.
>
> (defun erc-dcc-get-host (proc)
> (let ((sockaddr (plist-get (process-contact erc-process t) :local)))
> (when sockaddr
> (mapconcat #'number-to-string (subseq sockaddr 0 4) "."))))
I just installed a change to format-network-address, so you can now
omit the port number from the result string.
You may thus simplify your code like this (format-network-address
returns nil if the address is nil):
(defun erc-dcc-get-host (proc)
(let ((sockaddr (plist-get (process-contact erc-process t) :local)))
(format-network-address sockaddr t)))
--
Kim F. Storm <address@hidden> http://www.cua.dk