From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mark.d.witmer@gmail.com Newsgroups: gmane.lisp.guile.user Subject: Re: Trouble w/sockets Date: Sun, 03 Mar 2013 23:18:32 -0500 Message-ID: <87zjyjkdbb.fsf@gmail.com> References: <871ubxxie3.fsf@markwitmer.com> <1362286125.99740.YahooMailNeo@web120403.mail.ne1.yahoo.com> <87wqtp11va.fsf@markwitmer.com> <874ngtq6uw.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1362370722 15390 80.91.229.3 (4 Mar 2013 04:18:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Mar 2013 04:18:42 +0000 (UTC) Cc: guile-user@gnu.org To: Thien-Thi Nguyen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Mar 04 05:19:06 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCMrf-0003us-EE for guile-user@m.gmane.org; Mon, 04 Mar 2013 05:19:03 +0100 Original-Received: from localhost ([::1]:46683 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCMrJ-00015b-T5 for guile-user@m.gmane.org; Sun, 03 Mar 2013 23:18:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCMr9-00015J-NK for guile-user@gnu.org; Sun, 03 Mar 2013 23:18:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCMr4-0002LP-Uz for guile-user@gnu.org; Sun, 03 Mar 2013 23:18:31 -0500 Original-Received: from mail-ie0-x22f.google.com ([2607:f8b0:4001:c03::22f]:61072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCMr4-0002LL-QQ for guile-user@gnu.org; Sun, 03 Mar 2013 23:18:26 -0500 Original-Received: by mail-ie0-f175.google.com with SMTP id c12so5705870ieb.34 for ; Sun, 03 Mar 2013 20:18:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=8J3ZA2Z7JyhJk920Jg5vnmp3xOKQLB6+cA1iB3LMyng=; b=CnCPvNMRhA2WgNigSCiaqHUL699pIcSDl+jxWpEQCG+zRlrzCsP9HD2aC7ggyOGQ8f oHCKAKXSFNL1R7BWAkZWMxA5iX9S/tuqCRxl3taHVpNov8FWr2DTdHUNrtTHim8Mme2G cwvLIuam2PWADjKm1pWbE2xaLmsC3E07hICFfI4jmZmNDpmwADPVkpcPj6Kj4d+Ch0uR R5xexp9cL3nV90fmDy94oC8vBNDxzg/gDyOGKOXPMgMJn0EFtxgohj2raqn9uaqNjSZU F3UGHavS8i9CU14uDQYa/0YwW+t0/FuKhOZkNyPyxvXqCFg32+TME+VAXEkviyJTX4u1 ff/Q== X-Received: by 10.50.196.130 with SMTP id im2mr1329825igc.90.1362370706017; Sun, 03 Mar 2013 20:18:26 -0800 (PST) Original-Received: from localhost (cpe-184-58-115-186.woh.res.rr.com. [184.58.115.186]) by mx.google.com with ESMTPS id ur12sm9385204igb.8.2013.03.03.20.18.24 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 03 Mar 2013 20:18:25 -0800 (PST) In-Reply-To: <874ngtq6uw.fsf@zigzag.favinet> (Thien-Thi Nguyen's message of "Sun, 03 Mar 2013 08:29:11 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22f X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10165 Archived-At: Thien-Thi Nguyen writes: > () mark@markwitmer.com > () Sun, 03 Mar 2013 00:36:09 -0500 > > an error that the "resource is temporarily unavailable." Perhaps > there's something I need to do before connecting to the X server to > ensure that it doesn't hang up on me. > > Check out Xnest -- useful for sniffing protocol. Cool; I'll check it out. > > I suspect a little patience is all your code needs. E.g., see ttn-do > module =E2=80=98(ttn-do zzz x-protocol)=E2=80=99 proc =E2=80=98-connect= =E2=80=99, subproc =E2=80=98get-setup=E2=80=99, > wherein there is a =E2=80=98select=E2=80=99 + =E2=80=98usleep=E2=80=99 lo= op. Ok, that code helps a lot. I see that you use wrapped calls writev() and readv() to communicate with the socket. Using writev() gets rid of the broken pipe error and I successfully write my connection initiation request to the X server. But calls to readv() after I do the select + usleep loop you suggest here just give me garbage data. (read-char) gets #. > [cc trimmed] Thanks to everyone for their help. I feel like I'm close to figuing this out, but I probably need to take a break from this for a while. Hopefully I'll get this working at some point in the relatively near future! --=20 Mark Witmer