Client Server Networking Problem
1 Attachment(s)
Hi,
I'm using the example of Client and Server networking script for my problem. When I run the Server script it runs with no errors. But when I run the Client scripts I get the following error. Could you tell me what is this error? And how can I solve it? I would be grateful, if you could help me out as soon as possible. Thanks, Mihir |
Vizard serializes the arguments to a string and sends that to the remote computer. To serialize the data, Vizard uses the cPickle library that comes with Python. Perhaps you are trying to send an object that cPickle does not recognize.
It's difficult to tell without having a simple example that reproduces the error. For help with code on the forum it's always best to follow the posting Vizard code guidelines. |
1 Attachment(s)
Hi Jeff,
Its really difficult for me to produce an example that replicates my error. I have attached my code with as short as possible. As I am using the vizconnect tool. I have also attached the vizconnect_desktop.py my code is Code:
import csv |
It's urgent. Please help me out as soon as possible.
|
It looks like the transport object can't be sent using the network command and causes the cPickle error. Try sending the position and orientation of the transport every frame to all clients. On the receiving end, set the position and orientation of the transport:
Code:
transport.setPosition(pos) |
Hi Jeff,
I'm sorry I'm new to this Vizard. What changes should I make in my update function in my Client? Do you want me to change the e.GrabObject.setPosition(pos) to transport.setPosition(pos) correct on the client script? What changes do I need to make in the server script? I'm sorry for such silly question, but I new to programming as well. I am really sorry for the inconvenience caused |
Sorry, it's difficult to help because I don't really understand the code or what you are trying to do. Troubleshooting custom code is beyond the scope of what we can help with on the forum.
I'm not sure this is going to make things work the way you want but to avoid the error remove the transport object, which is called 'GrabObj' in the line below: Code:
viznet.client.sendAll(UPDATE,client=viz.getComputerName(),pos=pos,ori=ori,GrabObj=GrabObj,DisAssPart=DisAssPart ) Maybe there's an easier way of setting this up. Can you explain generally how your application is supposed to work? We can't necessarily provide code but may have suggestions. |
Hi Jeff,
I have a CAD model that is uploaded in the system. After that I am using the orientation and flying transports from the vizconnect tool to rotate the object in the virtual environment. Now, all I wanted is to do networking between two systems. For example, If I rotate the model in upward direction using transports in the client system, the information should get updated in the server system. I'm able to connect the systems the server displays the message of the client joined and left. But the client is not able to update the information and it is showing me the cPickle error. |
Does the example server/client scripts posted here work for you?
|
1 Attachment(s)
Hi Jeff,
The sample scripts are working. I did what you told me to do to remove the transport object i.e "GrabObj" after doing that I am getting the below error. |
Since you are no longer sending the GrabObj object, you can't receive it in the update function. You could try getting a handle to the transport in your script using the following:
Code:
transport = vizconnect.getTransport().getRaw() I can't guarantee that this will help or not. As I mentioned before, to get help with code on the forum it needs to follow the guidelines for posting code. For more in depth assistance, you might contact sales@worldviz.com and they can provide options for custom development and priority support. |
All times are GMT -7. The time now is 07:01 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC