Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions fcgiclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,26 @@ func (this *FCGIClient) Close() {
this.rwc.Close()
}

// Set timeout for all future and pending read and write operations
func (this *FCGIClient) SetTimeout(timeout time.Duration) error {
conn, ok := this.rwc.(net.Conn)
if !ok {
return errors.New("Invalid FCGIClient.rwc")
}

return conn.SetDeadline(time.Now().Add(timeout))
}

// Cancel timeout for all future and pending read and write operations
func (this *FCGIClient) CancelTimeout() error {
conn, ok := this.rwc.(net.Conn)
if !ok {
return errors.New("Invalid FCGIClient.rwc")
}

return conn.SetDeadline(time.Time{})
}

func (this *FCGIClient) writeRecord(recType uint8, content []byte) (err error) {
this.mutex.Lock()
defer this.mutex.Unlock()
Expand Down
Loading