Socket timeouts can be set on NpgsqlCommand via the CommandTimeout property. However, COPY operations don't provide any API to set the timeout.
The current workaround is to execute some command before the COPY operation and set the socket timeout there.
At least for raw binary, where we expose a standard stream, it may make sense to expose timeout control via ReadTimeout and WriteTimeout (see also CanTimeout), though we need to understand whether these should work for async as well, and how things interact with async cancellation tokens.
Don't forget to populate the cancellation token in the OperationCanceledException and assert (#3252)
Socket timeouts can be set on NpgsqlCommand via the CommandTimeout property. However, COPY operations don't provide any API to set the timeout.
The current workaround is to execute some command before the COPY operation and set the socket timeout there.
At least for raw binary, where we expose a standard stream, it may make sense to expose timeout control via ReadTimeout and WriteTimeout (see also CanTimeout), though we need to understand whether these should work for async as well, and how things interact with async cancellation tokens.
Don't forget to populate the cancellation token in the OperationCanceledException and assert (#3252)