Skip to content

Unity console keeps logging warning message: "Error communicating with Python server: The operation is not allowed on non-connected sockets." #48

Closed

Description

@lingllting

The Unity MCP Editor Window has a periodic check (every 2 seconds) that tries to verify the Python server connection:

if (Time.realtimeSinceStartup - lastCheckTime >= CONNECTION_CHECK_INTERVAL) // CONNECTION_CHECK_INTERVAL = 2f
{
    CheckPythonServerConnection();
    lastCheckTime = Time.realtimeSinceStartup;
}

This check tries to:
Connect to localhost:6400
Send a "ping" message
Wait for a "pong" response

The issue is that this check is using a different connection mechanism than the actual MCP commands. When you create objects or perform other actions, those go through the established MCP connection, but this status check creates a new TCP connection each time.
The error messages come from these periodic checks failing to establish new connections, even though the main MCP connection (used for actual commands) is working fine.

Activity

  1. added
    bug
    on Mar 25, 2025
  2. justinpbarnett commented on Apr 1, 2025

    @justinpbarnett
    Contributor

    Drastically extended the timeout (now 24 hours) and the buffer size. Should be fixed now since PR #68

  3. linked a pull request that will close this issueFeature/tool overhaul #68on Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions