zenozeng / ASABE-Robotics-Competition

ASABE Robotics Competition
1 stars 2 forks source link

软件架构 #5

Closed zenozeng closed 9 years ago

zenozeng commented 9 years ago

暂定为 cpp 控制机器,然后 cout 到文件里。 nodejs 写一个 server daemon 来控制和通讯。

Senorsen commented 9 years ago

禁用 stdout 的 buffer 后通过管道会不会更靠谱一些……?因为 cout 是 buffered 的,可能会导致不同步或其他问题。之前在 C / CPP 程序的日志记录中遇到这种问题。

zenozeng commented 9 years ago

你说直接 cpp listen一个端口?

On 2015年4月14日周二 19:13 Zhang Sen notifications@github.com wrote:

禁用 stdout 的 buffer 后通过管道会不会更靠谱一些……?因为 cout 是 buffered 的,可能会导致不同步或其他问题。之前在 C / CPP 程序的日志记录中遇到这种问题。

— Reply to this email directly or view it on GitHub https://github.com/zenozeng/ASABE-Robotics-Competition/issues/5#issuecomment-92773362 .

Senorsen commented 9 years ago

噗,也可以这样,似乎更科学一些……

或者利用 pipe 呀……不过一定要关掉 buffer 吧……

Senorsen commented 9 years ago

可以考虑吧…

Senorsen sen@senorsen.com On Apr 14, 2015 7:31 PM, "Zeno Zeng" notifications@github.com wrote:

你说直接 cpp listen一个端口?

On 2015年4月14日周二 19:13 Zhang Sen notifications@github.com wrote:

禁用 stdout 的 buffer 后通过管道会不会更靠谱一些……?因为 cout 是 buffered 的,可能会导致不同步或其他问题。之前在 C / CPP 程序的日志记录中遇到这种问题。

— Reply to this email directly or view it on GitHub < https://github.com/zenozeng/ASABE-Robotics-Competition/issues/5#issuecomment-92773362>

.

— Reply to this email directly or view it on GitHub https://github.com/zenozeng/ASABE-Robotics-Competition/issues/5#issuecomment-92776384 .

zenozeng commented 9 years ago

pipe意味着两个deamon要一起稳定运行。而如果是文件则可以在crash后保证log正常。

On 2015年4月14日周二 20:24 Zhang Sen notifications@github.com wrote:

可以考虑吧…

Senorsen sen@senorsen.com On Apr 14, 2015 7:31 PM, "Zeno Zeng" notifications@github.com wrote:

你说直接 cpp listen一个端口?

On 2015年4月14日周二 19:13 Zhang Sen notifications@github.com wrote:

禁用 stdout 的 buffer 后通过管道会不会更靠谱一些……?因为 cout 是 buffered 的,可能会导致不同步或其他问题。之前在 C / CPP 程序的日志记录中遇到这种问题。

— Reply to this email directly or view it on GitHub <

https://github.com/zenozeng/ASABE-Robotics-Competition/issues/5#issuecomment-92773362>

.

— Reply to this email directly or view it on GitHub < https://github.com/zenozeng/ASABE-Robotics-Competition/issues/5#issuecomment-92776384>

.

— Reply to this email directly or view it on GitHub https://github.com/zenozeng/ASABE-Robotics-Competition/issues/5#issuecomment-92789744 .

zenozeng commented 9 years ago

采用 Node.js - 内存方案。