We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer) cause = {ErrnoException@22155} "android.system.ErrnoException: sendto failed: ECONNRESET (Connection reset by peer)" detailMessage = "sendto failed: ECONNRESET (Connection reset by peer)" stackState = {Object[36]@22157} stackTrace = {StackTraceElement[0]@22158} suppressedExceptions = {Collections$EmptyList@22159} size = 0 shadow$klass = {Class@20115} "class java.net.SocketException" shadow$monitor = -1092557150
当我上传5张或者5张以上的图片时,就会报这个错误。 MultipartBody.Builder builder = new MultipartBody.Builder(); builder.setType(MultipartBody.FORM) .addFormDataPart("uid", MySharedPreferences.getUserInfo(TweetActivity.this).getUid()) .addFormDataPart("coustumeclass", selectCategory.getCname()) .addFormDataPart("clothestype", selectCategory.getClothestype()) .addFormDataPart("longitude", myLocation.getLongitude() + "") .addFormDataPart("latitude", myLocation.getLatitude() + "") .addFormDataPart("status", status);
if (selectBrand != null && selectBrand.getBid() != null) builder.addFormDataPart("bid", selectBrand.getBid()); if (selectStore != null && selectStore.getSaid() != null) { builder.addFormDataPart("signstores", selectStore.getStid()); builder.addFormDataPart("said", selectStore.getSaid()); builder.addFormDataPart("storesname", selectStore.getStname()); builder.addFormDataPart("stlongitude", selectStore.getStlongitude()); builder.addFormDataPart("stlatitude", selectStore.getStlatitude()); } if (selectSize != null) builder.addFormDataPart("size", selectSize); if (!modeTexts.isEmpty()) { String s = ""; for (int i = 0; i < modeTexts.size(); i++) { s += modeTexts.get(i) + Constant.TWEET_TEXT_DOT; } builder.addFormDataPart("introduce", s.substring(0, s.length() - Constant.TWEET_TEXT_DOT.length())); } if (selectBrand.getSaid() == null && url != null) { builder.addFormDataPart("link", url); } for (int i = 0; i < pathList.size(); i++) { /* String s; if (i == 0) { s = "headImage"; } else { s = "headImage" + i; }*/ builder.addFormDataPart("headImage", System.currentTimeMillis() + ".png", RequestBody.create(Constant.MEDIA_TYPE_PNG, new File(pathList.get(i)))); } RequestBody requestBody = builder.build(); okhttp3.Request request = new okhttp3.Request.Builder() .url(ApiManager.getRequestUrl(ApiManager.PUT_TWEET)) .post(requestBody) .build(); getClient().newCall(request).enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { LogUtils.d(e.toString()); sendOnFailure(); } @Override public void onResponse(Call call, Response response) throws IOException { if (response.isSuccessful()) { Gson gson = new Gson(); String result = response.body().string(); PutTweetRoot putTweetRoot = gson.fromJson(result, PutTweetRoot.class); if (putTweetRoot.getStatus() == ClientCode.SUCCEED) { sendOnResponse(); } else { sendOnError(putTweetRoot.getStatus()); } } else { sendOnFailure(); } } });
The text was updated successfully, but these errors were encountered:
Could you please provide an executable test case to demonstrate the problem?
Sorry, something went wrong.
I'm using okhttp v3.3.0, and this error occured while downloading the file.
No action to take on this.
No branches or pull requests
java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer)
cause = {ErrnoException@22155} "android.system.ErrnoException: sendto failed: ECONNRESET (Connection reset by peer)"
detailMessage = "sendto failed: ECONNRESET (Connection reset by peer)"
stackState = {Object[36]@22157}
stackTrace = {StackTraceElement[0]@22158}
suppressedExceptions = {Collections$EmptyList@22159} size = 0
shadow$klass = {Class@20115} "class java.net.SocketException"
shadow$monitor = -1092557150
当我上传5张或者5张以上的图片时,就会报这个错误。
MultipartBody.Builder builder = new MultipartBody.Builder();
builder.setType(MultipartBody.FORM)
.addFormDataPart("uid", MySharedPreferences.getUserInfo(TweetActivity.this).getUid())
.addFormDataPart("coustumeclass", selectCategory.getCname())
.addFormDataPart("clothestype", selectCategory.getClothestype())
.addFormDataPart("longitude", myLocation.getLongitude() + "")
.addFormDataPart("latitude", myLocation.getLatitude() + "")
.addFormDataPart("status", status);
The text was updated successfully, but these errors were encountered: