emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Local interface used for outbound network connections


From: Mario Lang
Subject: Re: Local interface used for outbound network connections
Date: Wed, 08 Jan 2003 15:49:16 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

address@hidden (Kim F. Storm) writes:

> Mario Lang <address@hidden> writes:
>
>> For IRC DCC connection, we need a reliable way to optain the IP
>> address we're reachable via.  Normally, IRC clients do this by calling
>> getsockname on the connection they have to the IRC server.  This
>> returns the interface used + port number.
>
> I definitely intended make-network-process to make this info
> available, but I forgot to implement it.  Thanks for reminding me :-)
>
> I have just committed the following changes to CVS:

Thanks a lot!  Tested, and works here.

(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) "."))))

-- 
CYa,
  Mario | Debian Developer <URL:http://debian.org/>
        | Get my public key via finger address@hidden
        | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44




reply via email to

[Prev in Thread] Current Thread [Next in Thread]