Socket hang up - oauth2 token

Hi,
Some time we are getting “socket hang up” error (/oauth2/token) during call file upload and download method.
This is not happening every time. But we stuck when it occurs.
Could you please help us to resolve this issue.
Thanks.