我正在尝试使用MQTT协议将Unity3d Android应用程序连接到ActiveMQ服务器。
在下面的日志中,我可以看到服务器拒绝连接。
我已正确地将所需端口转发到外部可访问。我还尝试使用设备的wi-fi从本地网络连接。
我正在使用MQTT库进行统一,可在此处找到:https://m2mqtt4unity.codeplex.com/
目前,同一个应用程序(可以在https://m2mqtt4unity.codeplex.com/documentation中找到的示例)在Unity编辑器和独立(.exe)中运行良好。我已正确设置activemq协议设置以允许MQTT。
我已经发布了有关使用NMS连接到activeMQ的其他问题: Subscribing to ActiveMQ from Unity3D app on Android
使用“adb logcat -s Unity”进行调试会抛出这个:
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
E/Unity (12824): Unable to find AudioPluginOculusSpatializer
D/Unity (12824): GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth24 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_required_internalformat GL_OES_vertex_array_object GL_OES_mapbuffer GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg GL_EXT_texture_type_2_10_10_10_REV GL_OES_fbo_render_mipmap GL_OES_element_index_uint GL_EXT_shadow_samplers GL_OES_texture_compression_astc GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_hdr GL_KHR_debug GL_EXT_occlusion_query_boolean GL_EXT_blend_minmax GL_EXT_discard_framebuffer GL_OES_get_program_binary GL_OES_texture_3D GL_EXT_texture_storage GL_EXT_multisampled_render_to_texture GL_OES_surfaceless_context GL_EXT_shader_pixel_local_storage GL_ARM_shader_framebuffer_fetch GL_ARM_shader_fram
D/Unity (12824): ebuffer_fetch_depth_stencil GL_ARM_mali_program_binary
I/Unity (12824): SocketException: Connection refused
I/Unity (12824): at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
I/Unity (12824): at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
I/Unity (12824): at uPLibrary.Networking.M2Mqtt.MqttNetworkChannel.Connect () [0x00000] in <filename unknown>:0
I/Unity (12824): at uPLibrary.Networking.M2Mqtt.MqttClient.Connect (System.String clientId, System.String username, System.String password, Boolean willRetain, Byte willQosLevel, Boolean willFlag, System.String willTopic, System.String willMessage, Boolean cleanSession, UInt16 keepAlivePeriod) [0x00000] in <filename unknown>:0
I/Unity (12824): Rethrow as MqttConnectionException: Exception connecting to the broker
I/Unity (12824): at uPLibrary.Networking.M2Mqtt.MqttClient.Connect (System.String clientId, System.String username, System.String password, Boolean willRetain, Byte willQosLevel, Boolean willFlag, System.String willTopic, System.String willMessage, Boolean cleanSession, UInt16 k