Android Socket Posix 实现

 Android Socket实现重用harmony项目 

 

socket/serversocket.java --> socketImpl.java     (java.net)

 

socketimpl.java --> java/net/plainsocketimpl.java   --> Libcore Os IoBridge etc (libcore.io)

socketimpl.java --> java/nio/SocketChannelImpl.java --> Libcore Os IoBridge etc (libcore.io)

 

libcore OS --> libcore/io/Posix.java --> libcore_io_Posix.cpp --> linux posix api  <sys/socket.h>   (accept)

libcore IoBridge --> libcore/io/Posix.java --> libcore_io_Posix.cpp --> linux posix api  <sys/socket.h>   (sendto, recvfrom, etc)

 

Posix.java通过JNI (libcore_io_Posix.cpp)调用linux的posix API,例如accept, sendto, recvfrom等

 

 

你可能感兴趣的:(java,android,android,socket,职场,休闲,posix)