javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp
branchRCL_3
changeset 24 6c158198356e
parent 14 04becd199f91
equal deleted inserted replaced
23:e5618cc85d74 24:6c158198356e
    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"
    20 #include "nativesocketconnection.h"
    21 #include "nativesocketconnection.h"
    21 
    22 #include "socketlocalhostinfo.h"
       
    23 #include "logger.h"
    22 
    24 
    23 using namespace java;
    25 using namespace java;
    24 
    26 
    25 JNIEXPORT jint JNICALL
    27 JNIEXPORT jint JNICALL
    26 Java_com_nokia_mj_impl_socket_SocketConnectionImpl__1createNativePeer
    28 Java_com_nokia_mj_impl_socket_SocketConnectionImpl__1createNativePeer
   139 (JNIEnv* /*aJni*/, jobject /*peer*/, jint aNativePeerHandle)
   141 (JNIEnv* /*aJni*/, jobject /*peer*/, jint aNativePeerHandle)
   140 {
   142 {
   141     NativeSocketConnection* nativeConn = reinterpret_cast<NativeSocketConnection* >(aNativePeerHandle);
   143     NativeSocketConnection* nativeConn = reinterpret_cast<NativeSocketConnection* >(aNativePeerHandle);
   142     delete nativeConn;
   144     delete nativeConn;
   143 }
   145 }
       
   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 }