我在U2宇宙手册中到处寻找,但我没有看到任何关于如何在调用submitRequest函数后关闭连接的示例。有人知道吗?
发布于 2014-08-16 04:30:54
不需要关闭连接,因为submitRequest内置了断开连接(和连接)功能。
如果您打开协议日志,您可以看到,在读取整个响应后,作为submitRequest的一部分,宇宙关闭了连接:
0574: 11/23/2010 16:18:41 [ 7440 6596 ] SSL read: status=NONE,len=7866
0575: 11/23/2010 16:18:41 [ 7440 6596 ] Socket 23dbe20: 7866 chars read
0576: 11/23/2010 16:18:41 [ 7440 6596 ] HTTP_MOREDATA: bytes_read=7866, total_re
ad=16058, bytes_remainig=0
0577: 11/23/2010 16:18:41 [ 7440 6596 ] HTTP_MOREDATA: data completely read
0578: 11/23/2010 16:18:41 [ 7440 6596 ] HTTP_FINISH
0579: 11/23/2010 16:18:41 [ 7440 6596 ] in destroySocket(): socket 23dbe20 refs=
1
0580: 11/23/2010 16:18:41 [ 7440 6596 ] Socket 23dbe20 closed and freed: 0(No er
ror) 0(No error)
0581: 11/23/2010 16:18:41 [ 7440 6596 ] Host 23711e0 freed你也可以看到宇宙作为submitRequest的一部分打开连接:
0067: 11/23/2010 16:18:39 [ 7440 6596 ] HTTP_START: timeout=60000
0068: 11/23/2010 16:18:39 [ 7440 6596 ] HTTP_CONNECT
0069: 11/23/2010 16:18:39 [ 7440 6596 ] new host 23711e0:www.example.org:4
43 allocated (proxy:no)
0070: 11/23/2010 16:18:39 [ 7440 6596 ] host www.example.org:443 not found
in hostList
0071: 11/23/2010 16:18:39 [ 7440 6596 ] socket 23dbe20 allocated
0072: 11/23/2010 16:18:39 [ 7440 6596 ] start SSLbinding ...作为一个有用的参考,这里有一个关于如何打开协议日志的示例:
LOGRECORDID = "MY_LOG_IN_THE_ROOT_OF_THE_ACCOUNT.LOG"
RESULT = protocolLogging(LOGRECORDID,"ON",10)
ERROR = submitRequest(requestHandle, httpTimeOut, mandrillDcdRec, responseHeaders, responseData, httpStatus)
RESULT = protocolLogging(LOGRECORDID,"OFF",0)https://stackoverflow.com/questions/25088068
复制相似问题