From: William Xu <william.xwl@gmail.com>
Subject: Re: GDS does not support Emacs 23?
Date: Sun, 24 Sep 2006 19:56:49 +0800 [thread overview]
Message-ID: <87k63tjx4u.fsf@www.williamxu.com> (raw)
In-Reply-To: <87r6y2i72x.fsf@ossau.uklinux.net> (Neil Jerram's message of "Sat, 23 Sep 2006 22:52:38 +0100")
Neil Jerram <neil@ossau.uklinux.net> writes:
> That's interesting. How can one call bind() so that it steals the
> address and port number from a previous listen socket?
Change socket from AF_INET to AF_UNIX does the trick. The following
patch seems to work fine. Now i can call gds-server from either Emacs
sessions. I only test it with gds-help-symbol, though. And there are
still some cleanups left to do, due to socket family change.
The patch,
---------------------------------8<-------------------------------------
xiaowei:~/studio/cvs/guile-debugging$ cvs diff
cvs server: Diffing .
cvs server: Diffing ice-9
cvs server: Diffing ice-9/debugging
cvs server: Diffing ossau
Index: ossau/gds-client.scm
===================================================================
RCS file: /cvs/guile-debugging/guile-debugging/ossau/gds-client.scm,v
retrieving revision 1.20
diff -r1.20 gds-client.scm
177,181c177,178
< (let ((s (socket PF_INET SOCK_STREAM 0))
< (SOL_TCP 6)
< (TCP_NODELAY 1))
< (setsockopt s SOL_TCP TCP_NODELAY 1)
< (connect s AF_INET (inet-aton "127.0.0.1") 8333)
---
> (let ((s (socket AF_UNIX SOCK_STREAM 0)))
> (connect s AF_UNIX "/tmp/.gds_socket")
Index: ossau/gds-server.scm
===================================================================
RCS file: /cvs/guile-debugging/guile-debugging/ossau/gds-server.scm,v
retrieving revision 1.4
diff -r1.4 gds-server.scm
9c9
< ;;
---
> ;;
14c14
< ;;
---
> ;;
40,45c40,46
<
< (let ((server (socket PF_INET SOCK_STREAM 0)))
<
< ;; Initialize server socket.
< (setsockopt server SOL_SOCKET SO_REUSEADDR 1)
< (bind server AF_INET INADDR_ANY port)
---
> ;; Initialize server socket.
> (let ((server (socket AF_UNIX SOCK_STREAM 0))
> (path "/tmp/.gds_socket"))
> (catch #t
> (lambda () (delete-file path))
> (lambda key #f))
> (bind server AF_UNIX path)
70c71
< (trc "client not found")))
---
> (trc "client not found")))
cvs server: Diffing ossau/debugging
---------------------------------8<-------------------------------------
--
William
"Trust me. I know what I'm doing."
-- Sledge Hammer
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2006-09-24 11:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-19 20:29 GDS does not support Emacs 23? netawater
2006-09-22 18:29 ` Neil Jerram
2006-09-22 23:10 ` William Xu
2006-09-23 9:48 ` Neil Jerram
2006-09-23 16:38 ` William Xu
2006-09-23 21:52 ` Neil Jerram
2006-09-24 11:56 ` William Xu [this message]
2006-09-27 18:40 ` Neil Jerram
2006-09-23 16:30 ` netawater
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/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k63tjx4u.fsf@www.williamxu.com \
--to=william.xwl@gmail.com \
/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.
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).