Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

arokem
Copy link
Owner

@arokem arokem commented Apr 21, 2015

See #168

@arokem
Copy link
Owner Author

arokem commented Apr 21, 2015

This is not implemented for windows, for now, since that takes a slightly different path (using TCP). I'd be happy for input on how this would work on Windows

@blink1073
Copy link
Collaborator

@arokem, we could use this on Windows: socket.bind_to_random_port(tcp_addr)

@arokem
Copy link
Owner Author

arokem commented Apr 21, 2015

Something like this?

On Tue, Apr 21, 2015 at 12:08 PM, Steven Silvester <[email protected]

wrote:

@arokem https://github.com/arokem, we could use this on Windows:
socket.bind_to_random_port(tcp_addr)


Reply to this email directly or view it on GitHub
#182 (comment)
.

@blink1073
Copy link
Collaborator

Yup.

@arokem
Copy link
Owner Author

arokem commented Apr 24, 2015

Can someone please try this out on a Windows machine to see it doesn't break anything?

@arokem
Copy link
Owner Author

arokem commented May 7, 2015

Hey @auneri - you are working on a Windows machine, right? Could you please pull from this branch and test that it works for you? I don't have a Windows machine to test on.

@auneri
Copy link
Contributor

auneri commented May 11, 2015

Sorry for the delayed response, I'll test this today, will let you know how it goes.

@arokem
Copy link
Owner Author

arokem commented May 11, 2015

Thanks! Let me know what you find. I do want to put out a new release next
week.

On Mon, May 11, 2015 at 7:55 AM, Ali Uneri [email protected] wrote:

Sorry for the delayed response, I'll test this today, will let you know
how it goes.


Reply to this email directly or view it on GitHub
#182 (comment)
.

@mmagnuski
Copy link

I tried testing this, unfortunatelly I am getting an error. 😢

This is what I get in matlab window:

Error using messenger
Socket creation failed.
Error in matlabserver (line 7)
messenger('init', socket_address); 

and in python:

Starting MATLAB on ZMQ socket tcp://127.0.0.1
Send 'exit' command to kill the server
............................................................MATLAB session timed out after 60 seconds
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-54e8c7114900> in <module>()
      1 # start matlab session
      2 mlab = Matlab()
----> 3 mlab.start()

D:\Python\Anaconda\lib\site-packages\pymatbridge\pymatbridge.pyc in start(self)
    221             return self
    222         else:
--> 223             raise ValueError("%s failed to start" % self._program_name())
    224 
    225     def _response(self, **kwargs):

ValueError: MATLAB failed to start

@auneri
Copy link
Contributor

auneri commented May 13, 2015

After applying the two fixes below I confirmed this fixes #168.

  1. Need to call self.socket.unbind(self.socket_addr) after appending port to socket_addr here.
  2. Call to _Session._runserver here needs to come after call to socket.unbind.

Unbind socket and run server after identifying random port
@arokem
Copy link
Owner Author

arokem commented May 14, 2015

Thanks @auneri - just making sure - this now works well for you on Windows? Ready to merge?

@auneri
Copy link
Contributor

auneri commented May 14, 2015

Yes, good to go.

arokem added a commit that referenced this pull request May 14, 2015
RF: Create a random socket location for every instance.
@arokem arokem merged commit bd04235 into master May 14, 2015
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.

4 participants