我可以从node.js设置ulimit吗?(Can I set ulimit from node.js?)
我想限制子进程写太多的数据或占用太多CPU时间(无限循环)。 在C中,我会调用setrlimit(2)来做到这一点。 在node.js中是否有这样的东西?
I'd like to restrict child processes from writing too much data or taking up too much cpu time (infinite loop). In C, I'd call setrlimit(2) to do that. Is there something like this in node.js?
原文:https://stackoverflow.com/questions/8141057
满意答案
在服务器端调用
close()
或flush()
:public static int PLAYER1 = 1; ObjectOutputStream oos = new ObjectOutputStream(player1.getOutputStream()); oos.writeInt(PLAYER1); oos.flush(); // OR oos.close();
flush()
将发送已写入客户端的任何数据。 这将使您可以重用oos
。如果你不再需要
oos
,请调用close()
。 调用close()
将刷新尚未发送的任何数据。Call
close()
orflush()
on server side:public static int PLAYER1 = 1; ObjectOutputStream oos = new ObjectOutputStream(player1.getOutputStream()); oos.writeInt(PLAYER1); oos.flush(); // OR oos.close();
flush()
will send any data already written to the client. This will leave you the possibility to reuseoos
.If you don't need
oos
anymore, callclose()
. Callingclose()
will flush any data not already sent.
相关问答
更多ObjectInputStream的(socket.getInputStream());(ObjectInputStream(socket.getInputStream()); does not work)
TCP Socket使用Android服务。(TCP Socket using Android service. how can i declare stream objects in MainActivity)
Java - 如何从Socket更新JProgressBar?(Java - How to update JProgressBar from Socket?)
Stream Socket错误处理winRT(Stream Socket error handling winRT)
Unity处理来自Socket的数据流(Unity Processing Data Stream from Socket)
Java Socket - 通过对象流传递int?(Java Socket - passing int through object stream?)
如何通过套接字发送套接字详细信息[关闭](How to send Socket details through a Socket [closed])
Java Socket Listener问题?(Java Socket Listener Issue?)
需要通过Socket获得字节帮助(Need help on bytes via Socket)
使用Socket的PHP到Java(PHP to Java using Socket)
相关文章
更多Node.js视频教程
《MLDN出品 魔乐科技Node.JS + MongoDB(JSP、HTML 、XML、JavaScript、Servlet、Struts、Ajax)视频汇总》(Node.JS + MongoDB\JSP、HTML 、XML、JavaScript、Servlet、Struts、Ajax nodejs)V2013[压缩包]
7月最新发布11.2.0.1.2 Patch set update
Hadoop的I/O
How to set up Solr on Ubuntu 10.04 (or whatever)
I18n的一个问题
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!