Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mrmesh dev #359

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Mrmesh dev #359

wants to merge 3 commits into from

Conversation

elinekupers
Copy link
Contributor

I use MATLAB R2020b on a M1 MacbookPro with Rosetta, and the wine hq app (https://www.winehq.org/) to open ./mrMesh/meshserver/mrMeshSrv.exe. (See also my response to this issue: #264).

The function "mrMesh/tcpToolbox/pnet_readMsg.m" kills the server if the wait time is too short.
I get the error message in the MATLAB command window below:

meshVisualize(vw.mesh{1})
mrmInitMesh: Add mesh actor...
Warning: could not read msg header.  Header length 0
 
> In pnet_readMsg (line 31)
In mrMesh (line 128)
In mrmSet (line 247)
In mrmInitMesh (line 29)
In meshVisualize (line 43) 
Warning: Error receiving server reply header. 
> In mrMesh (line 131)
In mrmSet (line 247)
In mrmInitMesh (line 29)
In meshVisualize (line 43) 
Warning: could not read msg header.  Header length 0
 
> In pnet_readMsg (line 31)
In mrMesh (line 70)
In mrmSet (line 389)
In mrmInitMesh (line 30)
In meshVisualize (line 43) 
Error using mrMesh (line 73)
Error receiving handshake reply.  Message length 0

Error in mrmSet (line 389)
         mrMesh(host, windowID, 'enable_origin_arrows', p);

Error in mrmInitMesh (line 30)
mrmSet(msh,'origin lines',0);

Error in meshVisualize (line 43)
[msh, lights] = mrmInitMesh(msh,backColor);

I fixed error by increasing the setreadtimeout from 2 to 4, for the "else" statement in vistasoft/mrMesh/tcpToolbox/pnet_readMsg.m (lines 24-26):

% Don't wait forever before aborting:
if ispc, pnet(con,'setreadtimeout',4);
else     pnet(con,'setreadtimeout',4);
end

As this makes the if statement obsolete, I changed it into a single line command:

% Don't wait forever before aborting:
pnet(con,'setreadtimeout',4);

…native host, that is, the mrmesh wine app. As both pc and unix now have the same wait time, if statement is obsolete and removed.
…th alternative host, that is, the mrmesh wine app. As both pc and unix now have the same wait time, if statement is obsolete and removed."

This reverts commit 694997f.
…native host, that is, the mrmesh wine app. As both pc and unix now have the same wait time, if statement is obsolete and removed.
@digital-pro
Copy link
Collaborator

Eline -- It's definitely helpful to increase these timeouts. However, we've found that in some cases, the timeouts need to be even longer, so it's not clear what the new default value should be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants