Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity SocketException: The socket has been shut down #1223

Open
PCoelho opened this issue Jun 18, 2024 · 0 comments
Open

Unity SocketException: The socket has been shut down #1223

PCoelho opened this issue Jun 18, 2024 · 0 comments

Comments

@PCoelho
Copy link

PCoelho commented Jun 18, 2024

I'm trying to run the simplest possible example using Unity within the editor. My server looks like this:

import ai2thor.controller
controller = ai2thor.controller.Controller(start_unity=False,
    port=8200,
    server_class=ai2thor.wsgi_server.WsgiServer,
    scene = "FloorPlan1_physics")

In Unity I'm opening the FloorPlan1_physics scene and pressing play. I added some debugs to wsgi_server.py and it seems to be receiving one event and sending out an action:

Received: <ai2thor.server.Event at 0x12cc93620
    .metadata["lastAction"] = None
    .metadata["lastActionSuccess"] = False
    .metadata["errorMessage"] = "None
    .metadata["actionReturn"] = None>
Sent: {'action': 'GetScenesInBuild'}

Unity then seems to send a second event, I'm assuming it's in response to GetScenesInBuild, but it fails with the error:

SocketException: The socket has been shut down
System.Net.Sockets.Socket.Send (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) (at <9768a808b86b4f53a2ebaf80bce151fe>:0)
System.Net.Sockets.Socket.Send (System.Byte[] buffer) (at <9768a808b86b4f53a2ebaf80bce151fe>:0)
AgentManager+<EmitFrame>d__102.MoveNext () (at Assets/Scripts/AgentManager.cs:1587)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/Coroutines.cs:17)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)

I'm guessing I'm doing something wrong. Can someone help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant