Skip to content

Using pyorient with DirectAccess #277

@teichmolch001

Description

@teichmolch001

I'm using pyorient==1.5.5 and encountered a problem while beeing connected vie DirectAccess to my companys network. Doing:

client = pyorient.OrientDB(serveradresse, port)
session_id = client.connect(user, pswd)

returned:

Traceback (most recent call last):
File "C:\xxx\orient.py", line 89, in connect
self._socket.connect( (self.host, self.port) )
TimeoutError: [WinError 10060] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat

Read of other issues with DirectAccess because of using IPv6, so i changed lines 67 and 89 in orient.py from

self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._socket.connect( (self.host, self.port) )

to

self._socket = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
self._socket.connect( (self.host, self.port, 0, 0) )

and this solved the problem. Haven't tested it any further though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions