Skip to content

Commit

Permalink
Updated to work with the with the iOS New VM.
Browse files Browse the repository at this point in the history
  • Loading branch information
shannah committed Feb 16, 2015
1 parent 74c7320 commit 53e5f2f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Binary file modified CN1SocketsDemo/lib/CN1Sockets.cn1lib
Binary file not shown.
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

<target name="jar" depends="compile,Stubs">
<mkdir dir="build/lib" />
<mkdir dir="build/stubs"/>
<zip basedir="${build.classes.dir}" compress="false" destfile="build/lib/main.zip" />
<zip basedir="build/stubs" compress="false" destfile="build/lib/stubs.zip" />
<copy file="manifest.properties" todir="build/lib" />
Expand Down
Binary file modified dist/CN1Sockets.cn1lib
Binary file not shown.
6 changes: 6 additions & 0 deletions native/ios/ca_weblite_codename1_net_impl_NativeSocketImpl.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,15 @@ -(int)readBuf:(int)len{
return -1;
}
errorMessage = NULL;
#ifndef NEW_CODENAME_ONE_VM
org_xmlvm_runtime_XMLVMArray* byteArray = ca_weblite_codename1_net_Socket_getBuffer___int(bufferId);
JAVA_ARRAY_BYTE* buffer = (JAVA_ARRAY_BYTE*)byteArray->fields.org_xmlvm_runtime_XMLVMArray.array_;
if ( len > byteArray->fields.org_xmlvm_runtime_XMLVMArray.length_){
#else
JAVA_ARRAY byteArray = (JAVA_ARRAY)ca_weblite_codename1_net_Socket_getBuffer___int_R_byte_1ARRAY(CN1_THREAD_GET_STATE_PASS_ARG bufferId);
JAVA_ARRAY_BYTE* buffer = (JAVA_ARRAY_BYTE*)byteArray->data;
if ( len > byteArray->length){
#endif
errorMessage = @"Attempt to read byte array longer than the buffer.";
return -2;
}
Expand Down

0 comments on commit 53e5f2f

Please sign in to comment.