有没有办法以编程方式关闭套接字连接?如果有任何解决方案,请帮帮我。
答案 0 :(得分:1)
Yes you can disconnect your socket connection
inputStream.delegate = nil;
[inputStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[inputStream close];
inputStream = nil;
isInputStreamOpen = NO;
outputStream.delegate = nil;
[outputStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[outputStream close];
outputStream = nil;
isOutputStreamOpen = NO;
inputBuffer = nil;
outputBuffer = nil;