rfl@oddjob.uchicago.edu (Bob Loewenstein) (07/14/90)
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.
resnick@lees.cogsci.uiuc.edu (Pete Resnick) (07/15/90)
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