[Socket] error 10061

53 views
Skip to first unread message

Rémi Deletrain

unread,
May 28, 2018, 11:30:09 AM5/28/18
to Python Programming for Autodesk Maya
Hi everyone,

For my animators I've created a tool for launch a motion capture movie reference in RV from maya scene file name and I connecting RV to Maya. With this tool it's possible to compare movie and animation juste with maya animation timeLine.
It's perfecly works in Maya 2014.

But with Maya 2018 I have a problem with python socket module. When i used socket.connect() i have this error:
    
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((s_host, i_port))

    [Errno 10061] No connection could be established because the target computer explicitly refused.


I search on internet a reason or/and solution but I don't found it...
Anyone have an idea ?

Justin Israel

unread,
May 28, 2018, 3:48:32 PM5/28/18
to python_in...@googlegroups.com
Are you trying to connect from RV to the Maya commandPort? If so, are you sure you have an open commandPort in that Maya 2018 instance at the given port number? 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c4f9ebbd-ac5d-4c16-a0e3-0c307e4797ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rémi Deletrain

unread,
May 29, 2018, 3:26:16 AM5/29/18
to Python Programming for Autodesk Maya
Hi Justin,

No it's the opposite that I'm trying to do, connected Maya to RV.
RV has a valid settings for accept connection from Maya2014, so I think is a same settings for Maya2018. 

Marcus Ottosson

unread,
May 29, 2018, 3:37:14 AM5/29/18
to python_in...@googlegroups.com

What is s_host and i_port? If the IP exists but port is inaccessible, you’ll get an error like that.

>>> import socket
>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> sock.connect(("localhost", 1))  # 1 is not available
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/adc4f9cf-5922-4ebb-8642-402c2ec5db28%40googlegroups.com.

Marcus Ottosson

unread,
May 29, 2018, 3:40:56 AM5/29/18
to python_in...@googlegroups.com
Ah, didn't read carefully enough, saw you mentioned it works under Maya 2014.

In that case, it sounds like either a firewall is blocking your Maya 2018, or a firewall is blocking everything and *allowing* your Maya 2014. What platform are you on? Are the Maya's running on the same machine? Have you tested on another machine? Have you tested connecting to anything else, like Google?

On 29 May 2018 at 08:37, Marcus Ottosson <konstr...@gmail.com> wrote:

What is s_host and i_port? If the IP exists but port is inaccessible, you’ll get an error like that.

>>> import socket
>>> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> sock.connect(("localhost", 1))  # 1 is not available
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
On 29 May 2018 at 08:26, Rémi Deletrain <remi.de...@gmail.com> wrote:
Hi Justin,

No it's the opposite that I'm trying to do, connected Maya to RV.
RV has a valid settings for accept connection from Maya2014, so I think is a same settings for Maya2018. 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscribe@googlegroups.com.

Rémi Deletrain

unread,
May 29, 2018, 3:56:12 AM5/29/18
to Python Programming for Autodesk Maya
Hi Marcus,

I used this variable:
    s_host = socket.gethostbyname("localhost")
    i_port = 45000 # RV default port

Hmmm, I do not know if my firewall is the problem. I ask my IT guy now !

Rémi Deletrain

unread,
May 29, 2018, 3:59:34 AM5/29/18
to Python Programming for Autodesk Maya
A priori aucun problème du coté du pare-feu. Je vais essa

Marcus Ottosson

unread,
May 29, 2018, 4:00:33 AM5/29/18
to python_in...@googlegroups.com
Je ne sais quoi!

On 29 May 2018 at 08:59, Rémi Deletrain <remi.de...@gmail.com> wrote:
A priori aucun problème du coté du pare-feu. Je vais essa

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/37c02e15-a94c-4330-8bd7-deaab965ca11%40googlegroups.com.

Rémi Deletrain

unread,
May 29, 2018, 4:01:04 AM5/29/18
to Python Programming for Autodesk Maya
Oups wrong manipulation.

No problem of the firewall detected with IT.
I try to communicate with google

Rémi Deletrain

unread,
May 29, 2018, 4:36:24 AM5/29/18
to Python Programming for Autodesk Maya
The connection with google works.
My IT guys say me firewall doesn't lock a localhost.

Justin Israel

unread,
May 29, 2018, 7:30:28 AM5/29/18
to python_in...@googlegroups.com
Yes connecting to another process on your localhost shouldn't be a matter of firewalls. 
So it's the same version of RV with different Maya versions? Have you tried connecting directly to 'localhost' instead of resolving your localhost public host name? There could be a difference in the resulting value. And if RV is only listening on a local interface then you wouldn't be able to connect on the public host name of the machine. 


On Tue, May 29, 2018, 8:36 PM Rémi Deletrain <remi.de...@gmail.com> wrote:
The connection with google works.
My IT guys say me firewall doesn't lock a localhost.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/bbc08774-e2a3-4561-a113-511b913d6c8a%40googlegroups.com.

Rémi Deletrain

unread,
May 29, 2018, 7:49:37 AM5/29/18
to Python Programming for Autodesk Maya
Thank you for your reply Justin,

Yes it's same version of RV (3.12.19-32). I try on Maya 2014 and Maya 2018.
I try with:
    - socketInstance.connect(("localhost", 45000))
    - socketInstance.connect((socket.gethostbyname("localhost"), 45000))

I'm sure RV listen a public host name because my computer is in RV contacts. If I delete contact and I launch my tool on Maya 2014 my computer is in RV  contacts again.
RV contacts saved are:
    - name: localhost
    - machine: ... (I don't give name on forum but is a valid name. Socket module arrived to resolve IPV4 adress)
    - permission: allow

And network settings is "Always Allow New Contacts"

Marcus Ottosson

unread,
May 29, 2018, 11:05:06 AM5/29/18
to python_in...@googlegroups.com
Have you tried on a different computer? Or with Maya 2015-2017? On a different OS?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/408f3231-f710-4228-9c9d-f91cdae6a42d%40googlegroups.com.

Rémi Deletrain

unread,
May 30, 2018, 8:33:03 AM5/30/18
to Python Programming for Autodesk Maya
I found the problem,

On maya 2014 the warning is considered a "real warning" except special case or it is a "warning error".
On maya 2018 the warning that I print to be considered as an error and therefore my try / except captures the error and sends it back to me ...

In fact the error of the socket module 10061 is normal ...

So my code with error is:
try:
    sock.connect((s_host, i_port))
    b_connected = True
except Exception, e:
    cmds.warning(e)
    b_connected = False

And solution is:
try:
    sock.connect((s_host, i_port))
    b_connected = True
except Exception, e:
    qd_logger.debug(e) # Python logging module
    b_connected = False


Reply all
Reply to author
Forward
0 new messages