From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: Re: New patch for server sockets and datagram (UDP) support. Date: 07 Mar 2002 13:54:10 +0100 Message-ID: <87g03c5yj1.fsf@home.delysid.org> References: <5xwux64cxe.fsf@kfs2.cua.dk> <5xg03pyyo3.fsf@kfs2.cua.dk> <5xadtvuodz.fsf@kfs2.cua.dk> <200202280408.g1S48QG19264@aztec.santafe.edu> <5xvgchkui4.fsf@kfs2.cua.dk> <200203012123.g21LNvS20494@aztec.santafe.edu> <5xofi1p7cz.fsf_-_@kfs2.cua.dk> NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: quimby2.netfonds.no 1015502699 8195 195.204.10.66 (7 Mar 2002 12:04:59 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 7 Mar 2002 12:04:59 GMT Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16iwdm-000285-00 for ; Thu, 07 Mar 2002 13:04:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16iwWG-0003OM-00; Thu, 07 Mar 2002 06:57:12 -0500 Original-Received: from [212.186.194.223] (helo=home.delysid.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16iwTH-0003FX-00 for ; Thu, 07 Mar 2002 06:54:07 -0500 Original-Received: from mlang by home.delysid.org with local (Exim 3.32 #1 (Debian)) id 16ixPO-00089T-00 for ; Thu, 07 Mar 2002 13:54:10 +0100 Original-To: emacs-devel@gnu.org In-Reply-To: <5xofi1p7cz.fsf_-_@kfs2.cua.dk> Original-Lines: 39 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1779 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1779 storm@cua.dk (Kim F. Storm) writes: > Richard Stallman writes: > > > If the HOST argument is nil, a server socket is opened which > > accepts connections. The sentinel is called - with a newly > > created process - whenever a connections is accepted. > > > > That sounds good to me in principle, if the details work ok. > > The following patch adds server socket support via open-network-stream. > If the HOST is nil, a server socket for SERVICE is opened in listening > state. OK, I compiled my emacs and played a bit with it. Here come my issues: 1. How do I bind to a random port? Normally, port 0 is used for that. I tried, it only partially works. I had Emacs listen on 42266 then, but: (setq my-process (open-network-stream "dcc" nil nil 0)) (process-contact my-process) => (nil 0 nil nil nil) Is it possible that process-contact would return the real port where Emacs is listening on? (BTW, the docstring of process-contact is wrong) Here is what netstat -lp told me after the code above was executed: tcp 0 0 *:42266 *:* LISTEN 25203/emacs 2. How am I supposed to bind to localhost only e.g. with this implementation??? -- Regards, Mario _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel