阻止虚拟机上 boot2docker vm 上的端口

阻止虚拟机上 boot2docker vm 上的端口

我有Boot2Docker图像运行在VirtualBox我的 Mac 上运行。我用风筝学在我的 Mac 上运行docker

我在虚拟机的activemq端口上运行了 docker 。我正在运行连接到端口的应用程序。32769boot2dockeractivemq32769

我的应用程序随机出现如下错误。

[INFO] stompest.async.listener: Disconnected: Connection to the other side was lost in a non-clean fashion.
[ERROR] stompest.async.listener: Disconnect failure: Unexpected connection loss [Connection to the other side was lost in a non-clean fashion.]
[INFO] stompest.async.protocol: Connecting to 10.4.252.37:61613 ...
[-] Starting factory <stompest.async.protocol.StompFactory instance at 0x231afc8>
[WARNING] stompest.async.protocol: Could not connect to 10.4.252.37:61613 [Connection was refused by other side: 111: Connection refused.]
[INFO] stompest.async.protocol: Delaying connect attempt for 10 ms
[Uninitialized] Stopping factory <stompest.async.protocol.StompFactory instance at 0x117e6c8>
[INFO] stompest.async.protocol: Connecting to 192.168.99.100:32769 ...
[-] Starting factory <stompest.async.protocol.StompFactory instance at 0x7f8ca428ec68>
[-] Unhandled error in Deferred:
2016-05-31 10:12:20+0000 [-] Unhandled Error
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks

File "/usr/local/lib/python2.7/dist-packages/stompest-2.1.2-py2.7.egg/stompest/util/__init__.py", line 16, in __checkattr

 File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1274, in unwindGenerator

--- <exception caught here> ---
 File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks

 File "/usr/local/lib/python2.7/dist-packages/stompest.async-2.1.1-py2.7.egg/stompest/async/client.py", line 275, in subscribe

 File "/usr/local/lib/python2.7/dist-packages/stompest-2.1.2-py2.7.egg/stompest/protocol/session.py", line 125, in subscribe

stompest.error.StompProtocolError: Already subscribed [id=test]

要重现此问题,我必须阻止端口32769并再次取消阻止,以便stompest将尝试再次连接并产生相同的错误。

我检查ifconfigboot2docker虚拟机,但它随机创建端口。

有什么办法可以阻止端口并再次解除阻止吗?

相关内容