you have to write native c codes and also u need to undertstand jni.with pure java you have no way to produce these low level networkingactions.