Java 如何解决“a”问题;Libcore“无例外的Posix-ThrowernOException”;当试图发布到服务器时?

Java 如何解决“a”问题;Libcore“无例外的Posix-ThrowernOException”;当试图发布到服务器时?,java,http,Java,Http,我正在尝试使用http和json将来自android应用程序的请求发布到服务器。 我有Wifi,可以访问远程计算机上的文件和目录。 在httpClient.execute(request);,我总是得到“Libcore\u io\u Posix-throwErrnoException”;。 我怎样才能解决这个问题 LogCat 05-06 16:36:17.871:I/系统输出(12160)::1 05-06 16:36:17.987:I/系统输出(12160):3 05-06 16:36:18

我正在尝试使用http和json将来自android应用程序的请求发布到服务器。 我有Wifi,可以访问远程计算机上的文件和目录。 在httpClient.execute(request);,我总是得到“Libcore\u io\u Posix-throwErrnoException”;。 我怎样才能解决这个问题

LogCat

05-06 16:36:17.871:I/系统输出(12160)::1

05-06 16:36:17.987:I/系统输出(12160):3

05-06 16:36:18.171:输入/系统输出(12160)::正常

05-06 16:36:18.266:I/System.out(12160):[socket][0]连接/192.168.2.6:8736;LocalPort=40941(0)

05-06 16:36:18.267:I/System.out(12160):[CDS]连接[/192.168.2.6:8736]tm:90

05-06 16:36:18.268:E/Posix(12160):[CDS]Libcore_io_Posix-throwernOexception,函数名:connect;错误号:操作正在进行中

05-06 16:36:18.292:I/System.out(12160):[socket][/192.168.2.214:40941]已连接

05-06 16:36:18.292:I/System.out(12160):[CDS]接收超时:0

05-06 16:36:18.303:I/System.out(12160):>doSendRequest

05-06 16:36:18.307:I/系统输出(12160): 05-06 16:36:19.024:I/SurfaceTextureClient(12160):[0x51659430]帧:4帧,持续时间:1.307000帧,每秒帧数:3.059500帧

05-06 16:36:20.030:I/SurfaceTextureReclient(12160):[0x51659430]帧:2,持续时间:1.005000,fps:1.988703

protected String doInBackground(String... urls) {

// Task starts executing.
String url = urls[0];
HttpClient httpClient = new DefaultHttpClient();

HttpPost request = new HttpPost("http://192.168.2.6:8736/AServerApp/V1/Stamp7");

String str = "details={\"DeviceName\":\"ATimekeeper\",\"BarCode\":\"13\"}";                     

StringEntity params = null;

try {
    params = new StringEntity(str);
} catch (UnsupportedEncodingException e1) {
    e1.printStackTrace();
}

request.setHeader("Accept", "application/json");
request.setHeader("Content-type", "application/json");

request.setEntity(params);
HttpResponse response = null;

try {
    response = httpClient.execute(request);             // <--  E/Posix(345): [CDS]Libcore_io_Posix-throwErrnoException, functionName: connect; errno: Operation now in progress


} catch (ClientProtocolException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
}
受保护的字符串doInBackground(字符串…URL){
//任务开始执行。
字符串url=url[0];
HttpClient HttpClient=新的DefaultHttpClient();
HttpPost请求=新建HttpPost(“http://192.168.2.6:8736/AServerApp/V1/Stamp7");
String str=“details={\'DeviceName\':\'ATimekeeper\',\'BarCode\':\'13\'”;
StringEntity参数=null;
试一试{
参数=新的StringEntity(str);
}捕获(不支持DencodingException e1){
e1.printStackTrace();
}
setHeader(“接受”、“应用程序/json”);
setHeader(“内容类型”、“应用程序/json”);
请求.setEntity(参数);
HttpResponse响应=null;
试一试{
response=httpClient.execute(请求)//
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ancon_timekeeper"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name="com.example.a_timekeeper.MainActivity"
        android:screenOrientation="portrait"
        android:label="@string/app_name" >

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />            
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>
</application>

</manifest>