Path: utzoo!utgpu!watserv1!watmath!att!dptg!ulysses!andante!mit-eddie!bu.edu!rpi!uwm.edu!ux1.cso.uiuc.edu!lees.cogsci.uiuc.edu!resnick From: resnick@lees.cogsci.uiuc.edu (Pete Resnick) Newsgroups: comp.sys.mac.comm Subject: Re: TCPRcv call in MacTCP Message-ID: <1990Jul14.211959.14776@ux1.cso.uiuc.edu> Date: 14 Jul 90 21:19:59 GMT References: <1990Jul14.024933.11241@midway.uchicago.edu> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 33 rfl@oddjob.uchicago.edu (Bob Loewenstein) writes: >I have a question I hope someone can answer concerning an asynchronous TCPRcv >call in MacTCP. I have a connection and start a TCPRcv with a Command Timeout of >0 (infinite). How do I abort this call in progress? The only way I can see is >for the sending machine to close the connection. >When the user quits the program, I would like to close the connection, but >can't since the command is still in progress. >I temporarily have my code working where the timeout is much shorter, say >a few seconds, and a watchdog reconnects when the call completes. If >I want to close the connection, my abort call waits until the call >completes on the short timeout and all works ok. However, there must >be a way to abort on an infinite timeout. I just go the low-down on this from DTS a week ago, though I was aborting a TCPPassiveOpen. You must create a second TCPiopb, pass it the ioCRefNum of the MacTCP driver (as always), a csCode of TCPAbort, and the stream pointer of the stream you want to kill. Call PBControl with asynch set to false. The PBControl call for the abort should complete with a return code of 0 and the ioResult of the stream you aborted will be -23012 (connectionTerminated). Your ioCompletion routine (if you have one) will be called. Good luck. 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@kant.cogsci.uiuc.edu BITNET (if no other way) : FREE0285@UIUCVMD