问题描述:

My daemon has option

-r WhereShouldIOutputAdditionalData

daemon is listening on port 26542 and writes on the same port , I want additional data to output to 26542 as well, I tried using

-r /dev/tcp/127.0.0.1/26542

and it doesn't work, When I do

> /dev/tcp/127.0.0.1/26542

I get connection refused. Deamon that I use: vowpal_wabbit, machine learning library.Any ideas?

网友答案:

Per an unoffical man page at

https://github.com/JohnLangford/vowpal_wabbit/wiki/Command-line-arguments

I see

-r [ --raw_predictions ] arg     File to output unnormalized predictions to

So I think the -r argument is expecting a sort of /path/to/logs/raw_preds.log argument.

With this, you'll have "captured the optional output so it is readable." You could open a separate window and use the dev/admins old friend tail -f /path/to/logs/raw_preds.log to see info as it is written to the file.

If you really want it all to appear on one port, (which isn't exactly clear from your question), you'd need a separate program that can multi-plex the outputs, AND has control of your required port number. Also you'll need to be concerned about correct order of output.

IHTH.

网友答案:

I'm sorry, what you want to do it's impossibile for two reasons:

First, bash cannot listen on a given TCP port. For example you cannot write a TCP server daemon in plain bash (you could use netcat for that), you can only connect() to a TCP port in bash.

Also, it is impossibile to listen on the same TCP ip:port that is already in LISTEN state by another process.

相关阅读:
Top