[comp.sys.mac.programmer] "MacTCP -- Duplicate IOC" user break in MacsBug?

jyp@wucs1.wustl.edu (Jerome Yvon Plun) (06/15/91)

My program crashes while executing a TCPRelease with a correct stream
(does what is expected of it until the TCPRelease).  The crash is actually
a MacsBug break in MacTCP and the message "MacTCP -- Duplicate IOC" appears.

This crash happens just after a kAEQuitApplication event has been received
from the Finder, in the routine taking care of closing the current stream
connection (with TCPAbort) and releasing the stream (with TCPRelease).

I can't find any information about that MacsBug message in the MacTCP 
Programmer's Guide so I am turning toward the knowledge of the Net for help.
What causes this break (the answer: "a duplicate IOC" will not be enough :-)?

Jerome

Jerome Plun            []  Is it a crime to want something else?
jyp@wucs1.wustl.edu    []  Is it a crime to believe in something different?
Washington University  []  
St Louis, MO           []  "Smalltown England", New Model Army, Vengeance

resnick@cogsci.uiuc.edu (Pete Resnick) (06/16/91)

jyp@wucs1.wustl.edu (Jerome Yvon Plun) writes:

>My program crashes while executing a TCPRelease with a correct stream
>(does what is expected of it until the TCPRelease).  The crash is actually
>a MacsBug break in MacTCP and the message "MacTCP -- Duplicate IOC" appears.

>This crash happens just after a kAEQuitApplication event has been received
>from the Finder, in the routine taking care of closing the current stream
>connection (with TCPAbort) and releasing the stream (with TCPRelease).

The TCPAbort is clearly the problem. I assume that you have created a
TCP stream which has an outstanding asynchronous call on it. Remember
that it is the *stream* you are aborting, not the parameter block.
Sending a parameter block to the device manager which is already in the
queue because a call has not yet completed is a definite no-no.  You
want to use a second parameter block to do the TCPAbort. The first
parameter block will complete with connectionTerminated in ioResult.
Any parameter block that does not have an outstanding asynchronous call
on it can be used again. If you can't get this to work and want sample
code, feel free to write to me and I will post it.

pr
--
Pete Resnick             (...so what is a mojo, and why would one be rising?)
Graduate assistant - Philosophy Department, Gregory Hall, UIUC
System manager - Cognitive Science Group, Beckman Institute, UIUC
Internet/ARPAnet/EDUnet  : resnick@cogsci.uiuc.edu
BITNET (if no other way) : FREE0285@UIUCVMD