javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp
branchRCL_3
changeset 83 26b2b12093af
parent 60 6c158198356e
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include "com_nokia_mj_impl_socket_SocketConnectionImpl.h"
    19 #include "com_nokia_mj_impl_socket_SocketConnectionImpl.h"
    20 #include "com_nokia_mj_impl_properties_socket_SocketDynamicPropertyHandler.h"
       
    21 #include "nativesocketconnection.h"
    20 #include "nativesocketconnection.h"
    22 #include "socketlocalhostinfo.h"
    21 
    23 #include "logger.h"
       
    24 
    22 
    25 using namespace java;
    23 using namespace java;
    26 
    24 
    27 JNIEXPORT jint JNICALL
    25 JNIEXPORT jint JNICALL
    28 Java_com_nokia_mj_impl_socket_SocketConnectionImpl__1createNativePeer
    26 Java_com_nokia_mj_impl_socket_SocketConnectionImpl__1createNativePeer
   141 (JNIEnv* /*aJni*/, jobject /*peer*/, jint aNativePeerHandle)
   139 (JNIEnv* /*aJni*/, jobject /*peer*/, jint aNativePeerHandle)
   142 {
   140 {
   143     NativeSocketConnection* nativeConn = reinterpret_cast<NativeSocketConnection* >(aNativePeerHandle);
   141     NativeSocketConnection* nativeConn = reinterpret_cast<NativeSocketConnection* >(aNativePeerHandle);
   144     delete nativeConn;
   142     delete nativeConn;
   145 }
   143 }
   146 
       
   147 JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_properties_socket_SocketDynamicPropertyHandler__1getLocalhostname
       
   148 (JNIEnv *aJni, jclass)
       
   149 {
       
   150     char* addr;
       
   151     addr = SocketLocalHostInfo::getLocalHostName();
       
   152     jstring jnistring = aJni->NewStringUTF(addr);
       
   153     delete[] addr;
       
   154     return jnistring;
       
   155 }