c++ - Read console input via select function -
I am trying to write a program that uses socket to send data to the network. Now I get input command from the console I have a selection function for sockets. In linux you can use selection to view data inputs in sockets and conols. How can I get the same functionality on Visual C ++?
When I put the console descriptor in the selected function, then error 10038 (socket operation on non-set).
Windows does not support using the Note that The easiest solution to read the console input is to use another thread. There is no way to include the console in your select for arbitrary handles In other forms of Linux and Unix, "All handles are identical", and it is not important whether they have been handled for a console, socket or something.
select does not handle any
in the windows, but a special
socket is the type of handle. See Definition of Windows
select call. There may be ways to explain Windows that a
socket is a wait-free object, and it has a console input handle Use some kind of simultaneously - but I'm not sure (and I do not have a Windows setup to try it out)
Comments
Post a Comment