Re: [Pyobjc-dev] Sockets, Files, Fun
Brought to you by:
ronaldoussoren
From: Martina O. <Ma...@Oe...> - 2003-02-01 18:25:23
|
Hi Just, Am Dienstag, 21.01.03 um 23:34 Uhr schrieb Just van Rossum: > I've played around a bit with NSFileHandle for sockets and came up with > a little demo that might actually be useful. It's called > TelnetInspect.py (see enclosed), and allows you to run a simple telnet > sever in your Cocoa app. Add this to your main program: I would like to try this out, but all I get is a bus error: Python 2.2 (#1, 07/14/02, 23:25:09) [GCC Apple cpp-precomp 6.14] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from TelnetInspect import TelnetServer >>> server = TelnetServer(port=9090) >>> from Foundation import NSRunLoop >>> NSRunLoop.currentRunLoop().run() Now, when I try to connect to this server in a second terminal window: [iBook:~] martina% telnet localhost 9090 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host. In the first terminal window, python exits with: Bus error I'm using PyObjc 0.8 on MacOS 10.2.3 with the Apple-supplied Python Any idea? ciao Martina |