开发者

How to get "server console"

开发者 https://www.devze.com 2023-03-05 03:47 出处:网络
I would like to write a server application which has a read in of the users commands but still outputting new events during the read in. It should look like e.g. the Minecraft server开发者_如何学JAVA

I would like to write a server application which has a read in of the users commands but still outputting new events during the read in. It should look like e.g. the Minecraft server开发者_如何学JAVA console. I tried some things but nothing worked and I'm out of ideas.


Check out

http://www.amazon.com/Pocket-Socket-Programming-Kaufmann-Practical/dp/1558606866

This is a great guide to learning sockets.

I would look start with the very simple TCP Listener example in the book.

You'll want your server to listen to a socket, read (parse) user commands, and respond accordingly.

If you're not tied to C++, you can do this pretty darn quickly with a Perl/Python/Ruby or even C#.


Read about libedit or GNU Readline.

0

精彩评论

暂无评论...
验证码 换一张
取 消