[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Using multiple sockets
- To: srfi-106@xxxxxxxxxxxxxxxxx
- Subject: Using multiple sockets
- From: GÃran Weinholt <goran@xxxxxxxxxxx>
- Date: Wed, 10 Oct 2012 12:33:02 +0200
- Delivered-to: srfi-106@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=weinholt.se; s=ratio; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=iRM0lxQX9G6kjPv/RUI9wew0gERSyq/KN2wIU3v0VwA=; b=oyOESajCSotDLOP9XOQ7hQCXH/kpKAnIsPTzh1vPeYj3De49kawtV8i1sFA/pIzJ8LGWDbSbg9LW9Gu7hk91STOw/FOI5/fEEgNvMPrBODyg5fESadNXHPOc/JCuyW6QMLJCzSu5riIALpjO1/jbaeVu6Z6PlK/vhlaJC/vJrcTvMi+XQBgsDK+F7f459lXs+wiELQBTPe5nTfsqL8zr8NSz3dHOEA7sNsBFZ8QqoKXEjoXM1aqQ7zz1aNEJUdXj;
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Hello list,
I noticed that the SRFI 106 draft does not mention any way of using
multiple sockets. Let's take a concrete example: an IRC server. The
server must be able to wait for new incoming connections and at the same
time wait for already connected clients to send commands. A good quality
IRC server also needs a non-blocking DNS resolver, so that it can look
up the hostnames of new clients. It will also try to connect to the
"ident" port of new clients, so it needs a non-blocking way to establish
new connections.
One way to write a server like this is by using threads or something
similar. Another way is to base it around non-blocking I/O and something
equivalent to the select() call from Unix, but this then needs to be
integrated with a DNS resolver library.
How would you suggest that SRFI 106 be used to write an IRC server?
Perhaps an IRC server seems a little too complicated for this SRFI, if
it aims to be simple. But most servers will need some aspect of what I
have described.
Regards,
--
GÃran Weinholt <goran@xxxxxxxxxxx>
"You never give me your money, you only give me your funny paper."
-- The Beatles