Hi
Having some problems with RPyC and ctypes

Local machine python 2.7.3 RPyC 3.2.3
Remote  machine python 2.7.4 RPyC 3.2.3

from ctypes import *
import rpyc

conn = rpyc.classic.connect(remoteHost)
niWlan = conn.modules.ctypes.WinDLL(wlanDll)
sessionName = c_char_p('WLANG')
compatibilityVersion = c_int(30000)
newSession = c_int(0)
niWlan.niWLANG_OpenSession(sessionName,
                             compatibilityVersion,
                             byref(wlanSession),
                             byref(newSession))

Gives
Traceback (most recent call last):
  File "wlanRx.py", line 477, in <module>
    main()
  File "wlanRx.py", line 469, in main
    configureToolkitSession(niWlan)
  File "alexandros\wlanRx.py", line 259, in configureToolkitSession
    byref(newSession))
  File "C:\Python27\lib\site-packages\rpyc\core\netref.py", line 196, in 
__call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "C:\Python27\lib\site-packages\rpyc\core\netref.py", line 71, in 
syncreq
    return conn.sync_request(handler, oid, *args)
  File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 438, in 
sync_request
    raise obj
ctypes.ArgumentError: argument 1: <type 'exceptions.TypeError'>: Don't know 
how to convert parameter 1

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 300, in 
_dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 532, in 
_handle_call
    return self._local_objects[oid](*args, **dict(kwargs))
ArgumentError: argument 1: <type 'exceptions.TypeError'>: Don't know how to 
convert parameter 1


Executing the same thing inside
conn.execute(sampleTxt)
with rpyc.classic.redirected_stdio(conn):
  conn.namespace['sample']()

It works nicely

Does RPyC have support for c_char_p, c_int, byref, pointer and the whole 
ctypes stuff?
Thanks


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"rpyc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to