简体   繁体   English

使用Functory模块时的Unix.Error 31写入

[英]Unix.error 31 write when using Functory module

I am using the functory module and I am facing a very bizarre issue with the code. 我正在使用功能模块,并且代码面临一个非常奇怪的问题。

My code is working fine and I have been able to parallelized a play on my game but when I try to play once again (launch another time a parallelized function) it raises a really weird error. 我的代码运行良好,并且能够并行处理游戏中的游戏,但是当我尝试再次进行游戏(再次启动并行化功能)时,会引发一个非常奇怪的错误。

Here you can find the error : 在这里您可以找到错误:

Fatal error: exception Unix.Unix_error(43, "write", "")
Raised by primitive operation at file "unix.ml", line 252, characters 7-34
Called from file "protocol.ml", line 45, characters 10-32
Re-raised at file "network.ml", line 536, characters 10-11
Called from file "network.ml", line 565, characters 47-80
Called from file "list.ml", line 73, characters 12-15
Called from file "network.ml", line 731, characters 4-27
Called from file "map_fold.ml", line 98, characters 4-242
Called from file "game_ia.ml", line 111, characters 10-54
Called from file "gameplay.ml", line 34, characters 12-48
Called from file "gameplay.ml", line 57, characters 22-37
Called from file "gameplay.ml", line 85, characters 5-22

So I've decided to search in the following folders to see what primitive operation has been raised : 因此,我决定在以下文件夹中进行搜索,以查看进行了哪些原始操作:

(unix.ml) external rename : string -> string -> unit = "unix_rename"
(network.ml) Some jid when w.state <> Disconnected -> send w (Protocol.Master.Kill jid)

So for some reason, it seems that my worker disconnects by itself. 因此,出于某种原因,看来我的工人自己断开了连接。 I was wondering if any of you already had this issue and what to do in order to solve it ? 我想知道你们中是否有人已经遇到过这个问题,该怎么做才能解决?

You can find my game here . 你可以在这里找到我的游戏。 The main files involved are game_ia.ml (best_move_parallelized) and gameplay.ml (at the very bottom). 涉及的主要文件是game_ia.ml(best_move_parallelized)和gameplay.ml(在最底部)。

Thank you in advance for your help. 预先感谢您的帮助。

The error you get is (type the following in the toploop)¹: 您得到的错误是(在toploop中键入以下内容)¹:

# (Obj.magic 43: Unix.error);;
- : Unix.error = Unix.EPROTOTYPE

which means: Protocol wrong type for socket . 这意味着: socket的协议错误类型 So you have to examine how you initialize your socket. 因此,您必须检查如何初始化套接字。

¹ You can also count the exceptions in unix.mli , knowing that the first one, E2BIG , is 0 . ¹知道第一个E2BIG0 ,您也可以在unix.mli计算异常。 Emacs Cu 43 ↓ helps. Emacs Cu 43 ↓帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM