Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0ba71f

Browse files
committed
add task return errcode in StnLogic
fix word spell error
1 parent bc53717 commit e0ba71f

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

mars/libraries/mars_android_sdk/src/main/java/com/tencent/mars/stn/StnLogic.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public Task(final int channelselect, final int cmdid, final String cgi, final Ar
9090

9191
public static final int INVALID_TASK_ID = -1;
9292

93-
// ErrCmdType
93+
// STN callback errType
9494
public static final int ectOK = 0;
9595
public static final int ectFalse = 1;
9696
public static final int ectDial = 2;
@@ -102,6 +102,27 @@ public Task(final int channelselect, final int cmdid, final String cgi, final Ar
102102
public static final int ectServer = 8;
103103
public static final int ectLocal = 9;
104104

105+
//STN callback errCode
106+
public static final int FIRSTPKGTIMEOUT = -500;
107+
public static final int PKGPKGTIMEOUT = -501;
108+
public static final int READWRITETIMEOUT = -502;
109+
public static final int TASKTIMEOUT = -503;
110+
111+
public static final int SOCKETNETWORKCHANGE = -10086;
112+
public static final int SOCKETMAKESOCKETPREPARED = -10087;
113+
public static final int SOCKETWRITENWITHNONBLOCK = -10088;
114+
public static final int SOCKETREADONCE = -10089;
115+
public static final int SOCKETSHUTDOWN = -10090;
116+
public static final int SOCKETRECVERR = -10091;
117+
public static final int SOCKETSENDERR = -10092;
118+
119+
public static final int HTTPSPLITHTTPHEADANDBODY = -10194;
120+
public static final int HTTPPARSESTATUSLINE = -10195;
121+
122+
public static final int NETMSGXPHANDLEBUFFERERR = -10504;
123+
124+
public static final int DNSMAKESOCKETPREPARED = -10606;
125+
105126
//reportConnectStatus
106127
//status
107128
public static final int NETWORK_UNKNOWN = -1;
@@ -125,6 +146,8 @@ public Task(final int channelselect, final int cmdid, final String cgi, final Ar
125146

126147
public static int TASK_END_SUCCESS = 0;
127148

149+
150+
128151
private static ICallBack callBack = null;
129152

130153
/**

mars/libraries/mars_android_sdk/src/main/java/com/tencent/mars/xlog/Xlog.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static class XLoggerInfo {
2727

2828
public static void open(boolean isLoadLib, int level, int mode, String cacheDir, String logDir, String nameprefix) {
2929
if (isLoadLib) {
30+
System.loadLibrary("stlport_shared");
3031
System.loadLibrary("marsxlog");
3132
}
3233

mars/stn/src/shortlink.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ SOCKET ShortLink::__RunConnect(ConnectProfile& _conn_profile) {
225225
__RunResponseError(kEctSocket, kEctSocketMakeSocketPrepared, _conn_profile, false);
226226
}
227227
else {
228-
_conn_profile.disconn_errtype = kEctCanceld;
228+
_conn_profile.disconn_errtype = kEctCanceled;
229229
__UpdateProfile(_conn_profile);
230230
}
231231

@@ -320,7 +320,7 @@ void ShortLink::__RunReadWrite(SOCKET _socket, int& _err_type, int& _err_code, C
320320

321321
if (breaker_.IsBreak()) {
322322
xinfo2(TSF"user cancel, nread:%_, nwrite:%_", socket_nread(_socket), socket_nwrite(_socket)) >> group_close;
323-
_conn_profile.disconn_errtype = kEctCanceld;
323+
_conn_profile.disconn_errtype = kEctCanceled;
324324
break;
325325
}
326326

mars/stn/stn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ enum ErrCmdType {
110110
kEctEnDecode = 7,
111111
kEctServer = 8,
112112
kEctLocal = 9,
113-
kEctCanceld = 10,
113+
kEctCanceled = 10,
114114
};
115115

116116
//error code

0 commit comments

Comments
 (0)