emacs-devel
[Top][All Lists]
Advanced

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

Re: New patch for server sockets and datagram (UDP) support.


From: Mario Lang
Subject: Re: New patch for server sockets and datagram (UDP) support.
Date: 07 Mar 2002 13:54:10 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

address@hidden (Kim F. Storm) writes:

> Richard Stallman <address@hidden> 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 <address@hidden>



reply via email to

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