serial port frustrations on win32

Erik Myllymaki erik at pacific-shores.com
Mon Dec 3 03:03:46 CET 2001


I put together a script to move SMDR records from a phone system into a SQL
database. It works great on my win2k laptop but it doesn't work on the nt
server (4.0 sp6a) that it is going to ultimately run on.

I've narrowed it down to not getting past a waitformultipleobjects() call -
hangs indefintely. I took that function straight from the
win32comport_demo.py file in the win32\Demos folder of the standard install.

I ran win32comport_demo.py and it works great on the win2k lapop, but once
again it hangs at the same point on the NT server(i won't include the whole
file):

    def _ComPortThread(self):
        overlapped = OVERLAPPED()
        overlapped.hEvent = CreateEvent(None, 0, 0, None)
        while 1:
            # XXX - note we could _probably_ just use overlapped IO on the
win32file.ReadFile() statement
            # XXX but this tests the COM stuff!
            rc, mask = WaitCommEvent(self.handle, overlapped)
            if rc == 0: # Character already ready!
                SetEvent(overlapped.hEvent)
            rc = WaitForMultipleObjects([overlapped.hEvent, self.eventStop],
0, INFINITE)
^^^^^^^^^^^^^^^^
 -hangs here forever-


Any help appreciated.

--
Erik Myllymaki
erik at pacific-shores.com





More information about the Python-list mailing list