Problems using viznet.client.connect
Hi,
I am trying to set up automated server-client connection between the machines in our virtual reality network. Our network consists of 3 computers (MASTER, HEAD1, HEAD2). Working with the basic elements from the Vizard Help > Reference > Networking > Multi User environment works fine. But this approach needs always the master starting first, then the client, and when the master is disconnected it does not reconnect. So I was playing around a bit but ran into several issues: 1. When reading Help: the command index for Code:
if viznet.client.connect('MASTER'): Code:
>>> import viz Code:
>>> import viz 3. Because we already use the command successfully from script, next thing I try is putting these commands into a python script: Code:
import viz HEAD1: executing script & starting server and the simulation HEAD2: online being idle, not running Vizard HEAD3: not on the network MASTER: executing the script, displaying the following output result: Code:
testing machine: MASTER -> connected +++ BTW, without the line marked with (1) even HMD3 would look like connected; so it seems further that viznet.client.connect returns True when already connected, ignoring that the connection request was for another machine. If I am not doing anything wrong, then I would recommend that WorldViz changes the connect command in that it only returns true when there is indeed a connection established with the requested machine, meaning that there runs the server. And returns a couple of errors like
Any comments and/or ideas and/or solutions? Thanks, Walter |
continued
No luck with an answer yet, so I look for a work-around myself. Extend the communication protocol with a connection-test and connect-confirm network events
Code:
import viz Code:
if myName == 'HEAD1': Code:
def srvrConnectTest(e): Code:
import threading Code:
asking for connection confirmation... Thanks, Best Regards, Walter |
Hi,
A couple things to note:
I'd recommend looking into the Python Twisted library. It supports much more advanced networking features. However, you can perform a blocking handshake by manually updating the network events in a while loop. Here is a minimal example: Server code: Code:
import viz Code:
import viz |
All times are GMT -7. The time now is 06:42 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC