replace getNetListenAddress with native function
This commit is contained in:
1 parent
66fe4fee09
commit
873849d4aa
2 files changed
+18
-35
No files matched your search
@@ -928,6 +928,22 @@ JNIEXPORT void SIGAR_JNI(NetStat_stat)
|
||||
JENV->SetObjectField(env, obj, id, states);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring SIGAR_JNIx(getNetListenAddress)
|
||||
(JNIEnv *env, jobject sigar_obj, jlong port)
|
||||
{
|
||||
int status;
|
||||
sigar_net_address_t address;
|
||||
dSIGAR(NULL);
|
||||
|
||||
status = sigar_net_listen_address_get(sigar, port, &address);
|
||||
if (status != SIGAR_OK) {
|
||||
sigar_throw_error(env, jsigar, status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return jnet_address_to_string(env, sigar, &address);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring SIGAR_JNI(NetConnection_getTypeString)
|
||||
(JNIEnv *env, jobject obj)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user