开发者社区> 问答> 正文

oss访问 远程主机强迫关闭了一个现有的连接

Unable to write data to the transport connection: 远程主机强迫关闭了一个现有的连接。.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at Aliyun.OSS.Util.IoUtils.WriteTo(Stream orignStream, Stream destStream, Int64 totalSize)
at Aliyun.OSS.Common.Communication.ServiceClientImpl.SetRequestContent(HttpWebRequest webRequest, ServiceRequest serviceRequest, Boolean async, OssAction asyncCallback)
at Aliyun.OSS.Common.Communication.ServiceClientImpl.SendCore(ServiceRequest serviceRequest, ExecutionContext context)
at Aliyun.OSS.Common.Communication.ServiceClient.Send(ServiceRequest request, ExecutionContext context)
at Aliyun.OSS.Common.Communication.RetryableServiceClient.SendImpl(ServiceRequest request, ExecutionContext context, Int32 retryTimes)
at Aliyun.OSS.Common.Communication.RetryableServiceClient.Send(ServiceRequest request, ExecutionContext context)
at Aliyun.OSS.Commands.OssCommand.Execute()
at Aliyun.OSS.OssClient.PutObject(String bucketName, String key, Stream content, ObjectMetadata metadata)
at Aliyun.OSS.OssClient.PutObject(String bucketName, String key, Stream content)
at WindowsFormsApplication1.Form1.button3_Click(Object sender, EventArgs e)

展开
收起
mychina269 2016-03-24 17:41:02 9633 0
2 条回答
写回答
取消 提交回答
  • OSS.=====Exception发送图片异常====System.IO.IOException: 无法将数据写入传输连接: 远程主机强迫关闭了一个现有的连接。。 ---> System.Net.Sockets.SocketException: 远程主机强迫关闭了一个现有的连接。 在 System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) 在 System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) --- 内部异常堆栈跟踪的结尾 --- 在 System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) 在 System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) 在 System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) 在 System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) 在 System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) 在 System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) 在 System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size) 在 Aliyun.OSS.Util.IoUtils.WriteTo(Stream orignStream, Stream destStream, Int64 totalSize) 在 Aliyun.OSS.Common.Communication.ServiceClientImpl.SetRequestContent(HttpWebRequest webRequest, ServiceRequest serviceRequest, Boolean async, OssAction asyncCallback) 在 Aliyun.OSS.Common.Communication.ServiceClientImpl.SendCore(ServiceRequest serviceRequest, ExecutionContext context) 在 Aliyun.OSS.Common.Communication.ServiceClient.Send(ServiceRequest request, ExecutionContext context) 在 Aliyun.OSS.Common.Communication.RetryableServiceClient.SendImpl(ServiceRequest request, ExecutionContext context, Int32 retryTimes) 在 Aliyun.OSS.Common.Communication.RetryableServiceClient.Send(ServiceRequest request, ExecutionContext context) 在 Aliyun.OSS.Commands.OssCommand.Execute() 在 Aliyun.OSS.Commands.OssCommand`1.Execute() 在 Aliyun.OSS.OssClient.PutObject(PutObjectRequest putObjectRequest) 在 Aliyun.OSS.OssClient.PutObject(String bucketName, String key, Stream content, ObjectMetadata metadata) 在 Aliyun.OSS.OssClient.PutObject(String bucketName, String key, String fileToUpload, ObjectMetadata metadata) 在 Aliyun.OSS.OssClient.PutObject(String bucketName, String key, String fileToUpload) 在 Aliyun.OSS.Sdk.JSST.SDK.PutObject.PutObjectFromFile(String bucketName, String key, String localFilePath, Result& resultMessage)

    2019-11-19 22:16:08
    赞同 展开评论 打赏
  • OSS的安全防护有防盗链、ACL权限控制和跨域控制的功能,是没有根据IP进行限制的,从上面的情况上看是该用户到OSS的连接被reset导致无法连接,这种问题如果可以复现的话建议可以提交工单让阿里云的工程师和该用户一起抓包看下是哪里发的reset包导致连接中断的。

    2019-07-17 18:35:40
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
OSS运维进阶实战手册 立即下载
《OSS运维基础实战手册》 立即下载
OSS运维基础实战手册 立即下载