unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: no-spam@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: New patch for server sockets and datagram (UDP) support.
Date: 07 Mar 2002 17:09:03 +0100	[thread overview]
Message-ID: <5xvgc8nyw0.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <200203071518.QAA17238@xaital.online-marketwatch.com>

Helmut Eller <helmut@xaital.km4u.net> writes:

Thanks Helmut,
I appreciate your comments.  See below.


> storm@cua.dk (Kim F. Storm) writes:
> 
> > What do you think?
> 
> You are adding many features at the same time; it's a bit hard to see
> what your problem actually is :-)

I agree -- but doing it all in one big step does reveal more of the
API related problems than doing it step by step (as I did with the
non-blocking argument to open-network-stream).
 
> I think it's a _very good_ idea to rename open-network-stream to
> something different, because this frees you from being backward
> compatible.

That's right.  It definitely has advantages to do that.
> 
> Have you considered to use keyword arguments, e.g., in the spirit of
> the make-socket function found in Allegro CL?
> <http://www.franz.com/support/documentation/5.0.1/doc/cl/socket.htm>
> 

I have considered doing that, but I don't think there is any tradition
for doing that in emacs lisp built-in functions.  But I agree that it
gives more flexibility in combining various options, so if that is
ok with the rest of the developers, I will look into that path.

> It's probably a pain to parse keyword arguments in C, but it frees you
> from overloading positional arguments in an unnatural way.  It would
> also be quite nice to use from Lisp.  Another advantage is that you
> could add new arguments without much backward compatibility
> restrictions.

It still has the problem of what to do with unknown arguments --
but at least it will not trigger the debugger due to an incorrect
number of arguments.

> 
> Another point: if someone wants to bind a socket to a specific
> interface he must be able to specify the IP address, the hostname is
> IMHO not sufficient for this.  Any ideas for this problem?

I'll have to think about that, but again keyword arguments could
be helpful here.

>  I propose
> to make gethostbyname and related functions available to Lisp.  IP
> addresses could be represented by vectors of 4 bytes (it's a pity that
> 32bit don't fit into a ELisp fixnum).
>

Not that I object to this in general, but for what purpose? 

> Yet another point: please, please, please make accept-connection a
> separate function.  Then one could make a _blocking_ accept; also
> accept with a timeout argument would be possible.

I understand that you want to serialize the connections.
Why is it necessary to do that?  Each connection gets its own
process (and buffer etc), so they should be able to co-exist.

If it is a matter of resources, then I think there are other ways we
could consider to handle this (e.g. a `:max-conn 5' parameter) to
limit the number of concurrent servers running.  Or we could make the
`stop-process' function applicable to server sockets to stop/start
listening.

AFAICS, your accept-connection call doesn't really accept anything;
it just allows the server to accept a (one) connection if one is
received.  If you don't want to accept more connections, you can
delete the server process in the sentinel.

And you can start a timer to cancel the accept (by calling
delete-process) if a connection hasn't been received.
The sentinel can cancel (or restart) that timer if a
connection is accepted.


>  Would this add any > implementation complexity?

Yes.  (I'll elaborate more on this when I understand what
you are trying to accomplish).


> 
> Helmut.
> 

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


  reply	other threads:[~2002-03-07 16:09 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2u1sa7819.fsf@xaital.online-marketwatch.com>
2002-02-21 23:45 ` Non-blocking open-network-stream Kim F. Storm
2002-02-22 16:04   ` Stefan Monnier
2002-02-25 22:38   ` Kim F. Storm
2002-02-26 22:46     ` Helmut Eller
2002-02-27 11:59       ` Kim F. Storm
2002-02-28  4:08         ` Richard Stallman
2002-03-01  0:21           ` Kim F. Storm
2002-03-01  8:01             ` Juanma Barranquero
2002-03-01 10:50               ` Kim F. Storm
2002-03-01 17:10                 ` Pavel Janík
2002-03-01 21:23             ` Richard Stallman
2002-03-07  0:08               ` New patch for server sockets and datagram (UDP) support Kim F. Storm
2002-03-07 10:56                 ` Kim F. Storm
2002-03-07 11:39                   ` Alex Schroeder
2002-03-07 12:39                     ` Kim F. Storm
2002-03-07 14:51                       ` Alex Schroeder
2002-03-08 21:06                       ` Richard Stallman
2002-03-13 15:56                         ` Kim F. Storm
2002-03-13 23:19                           ` Final(?) " Kim F. Storm
2002-03-14  0:50                             ` Al Petrofsky
2002-03-14  9:30                               ` Kim F. Storm
2002-03-14 12:42                               ` Richard Stallman
2002-03-14 13:35                                 ` Kim F. Storm
2002-03-17 22:02                             ` I have installed the " Kim F. Storm
2002-03-07 15:18                   ` New " Helmut Eller
2002-03-07 16:09                     ` Kim F. Storm [this message]
2002-03-07 17:32                       ` Helmut Eller
2002-03-07 23:58                         ` Kim F. Storm
2002-03-08  7:38                           ` Helmut Eller
2002-03-08  9:13                             ` Kim F. Storm
2002-03-08 11:16                               ` Helmut Eller
2002-03-08 16:36                               ` Stefan Monnier
2002-03-08 20:57                                 ` Kim F. Storm
2002-03-08 21:03                                   ` Stefan Monnier
2002-03-08 21:07                             ` Richard Stallman
2002-03-13 15:12                               ` Kim F. Storm
2002-03-07 12:54                 ` Mario Lang
2002-03-07 12:58                   ` Kim F. Storm
2002-03-08  9:09                 ` Richard Stallman
2002-03-08  9:35                   ` Kim F. Storm
2002-03-08 11:04                   ` Helmut Eller
2002-03-02  7:59             ` Non-blocking open-network-stream Helmut Eller
2002-03-03  0:12               ` Kim F. Storm
2002-03-03 10:46                 ` Helmut Eller
2002-03-03 16:44                 ` Mario Lang
2002-03-03 14:39               ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5xvgc8nyw0.fsf@kfs2.cua.dk \
    --to=no-spam@cua.dk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).