MCPcopy
hub / github.com/request/request / setReqTimeout

Function setReqTimeout

request.js:807–822  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

805 }
806
807 var setReqTimeout = function () {
808 // This timeout sets the amount of time to wait *between* bytes sent
809 // from the server once connected.
810 //
811 // In particular, it's useful for erroring if the server fails to send
812 // data halfway through streaming a response.
813 self.req.setTimeout(timeout, function () {
814 if (self.req) {
815 self.abort()
816 var e = new Error('ESOCKETTIMEDOUT')
817 e.code = 'ESOCKETTIMEDOUT'
818 e.connect = false
819 self.emit('error', e)
820 }
821 })
822 }
823 if (timeout !== undefined) {
824 // Only start the connection timer if we're actually connecting a new
825 // socket, otherwise if we're already connected (because this is a

Callers 2

onReqSockConnectFunction · 0.85
request.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…