Re: Simple SSL client hangs

2021-07-13 Thread Douglas Wells
In article <871r821wlg@hornfels.zedat.fu-berlin.de>, Loris Bennett wrote: >In Perl I have the following > > use IO::Socket::SSL; > my $my_socket = new IO::Socket::SSL(PeerAddr => 'some.server.somewhere, > PeerPort => 12345, >

Re: Kill an OS process from script (perhaps unix specific)

2008-04-19 Thread Douglas Wells
not just an arbitrary delay), you could use the simple construct: import os code = os.system ("ulimit -t ; ...") That's not guaranteed to work on all POSIX systems, but it should work with at least ash, bash, and ksh. And it would would be "limit cputime ; ...&q

Re: subprocess.Popen pipeline bug?

2008-03-13 Thread Douglas Wells
/dev/null',shell = True,stdin = a.stdout) b = subprocess.Popen('cat >/dev/null',shell = True,stdin = a.stdout, close_fds = True) # * end of changes a.stdin.close() b.wait() a.wait() Good luck. - dmw -- . Douglas Wells . Connection Technologies . . Internet: -sp9804- -at - contek.com- . -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading the Python interpreter

2008-02-19 Thread Douglas Wells
ms were eventually accepted by the larger computing community with little change in their original meanings. But, the OP should still be safe. - dmw -- . Douglas Wells . Connection Technologies . . Internet: -sp9804- -at - contek.com- . -- http://mail.python.org/mailman/listinfo/python-list

Re: sockets -- basic udp client

2008-02-17 Thread Douglas Wells
one non-zero length response (such that buf is modified) and seeing if it ever terminates. I would also like to point out that the original example (quoted from the book) used "connect' and "recv" w/ UDP). One of the purposes of using this construct (rather than using "recvfrom") is to simplify identification of the remote system: When you "connect" to a UDP socket, the OS will only send messages to that system and will ignore messages that do not originate from that IP address (ignoring the issue IP address spoofing). - dmw -- . Douglas Wells . Connection Technologies . . Internet: -sp9804- -at - contek.com- . -- http://mail.python.org/mailman/listinfo/python-list

Re: Can anyone help, please?

2008-02-13 Thread Douglas Wells
- start print "%7.3f: %d octets from %s" % (elapsed, total_data_length, addr) except socket.error, e: print "Socket error" + e break ## ==

Re: Socket - gaierror

2007-08-27 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: > On Aug 27, 4:22 pm, [EMAIL PROTECTED] (Douglas Wells) wrote: > > In article <[EMAIL PROTECTED]>, > > > > [EMAIL PROTECTED] writes: > > > On Aug 27, 12:32 pm, Larry Bates <[EMAIL PROTECTED]

Re: Socket - gaierror

2007-08-27 Thread Douglas Wells
s in DNS. In UNIX/Linux you can use the hostname command; in any system you can write a python script to print the result of socket.gethostname(). - dmw -- . Douglas Wells . Connection Technologies . . Internet: -sp9804- -at - contek.com- . -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparing RFC1123 based Dates

2007-08-05 Thread Douglas Wells
limited to processing date/times. Even then, I then explicitly set the locale (LC_TIME) to the "C" locale. Otherwise, I use ad hoc code that explicitly recognizes the RFC-defined forms. -- . Douglas Wells . Connection Technologies . . Internet: -sp9804- -at - contek.com- . -- http://mail.python.org/mailman/listinfo/python-list

Re: asyncore and OOB data

2007-07-12 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, billiejoex <[EMAIL PROTECTED]> writes: > Douglas Wells wrote: > > > Second, when I look at the FTP specification, I don't find the > > concept of OOB anywhere. So, it's not clear what OOB data would > > mean in

Re: asyncore and OOB data

2007-07-12 Thread Douglas Wells
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> writes: > Douglas Wells wrote: > > > > Third, the TCP protocol, which you have selected via the SOCK_STREAM > > option doesn't support OOB at all, so there's no way that you can > &

Re: asyncore and OOB data

2007-07-11 Thread Douglas Wells
n my system, I get back an error (EINVAL - Invalid argument). I would expect that asyncore would report this error somehow or other. In summary, you almost certainly can't use the concept of a separate OOB channel to transfer data in an FTP environment. If you really, really need something like

Re: Convert to C/C++?

2007-06-14 Thread Douglas Wells
self.timestamp, self.time_low, self.time_mid, > self.time_hi_version > #print 'clock_seq ', self.clock_seq, self.clock_seq_low, > self.clock_seq_hi_variant > > vs unix gettimeofday > > int gettimeofday(struct timeval *tp, struct timezone *tzp); By the way, the UNIX

Re: result of os.times() is different with 'time' command

2007-02-02 Thread Douglas Wells
d 100 on the OP's OS X(*). (BTW, this sort of historic code is exactly why POSIX no longer defines HZ.) In support of this, I note that the following ratios exist: user time from os.times / user time from time command 39.85 / 23.938 => 1.665