views:

46

answers:

3

Hi why each none blocking server is build with C ? cant i build it with c++ ?

A: 

Since you can call c functions from c++, yes. I've used non-blocking sockets in c++ and so have a lot of other people.

dutt
who did you use it ?
why did I use non-blocking sockets or why did I use c++?
dutt
A: 

There is good library - asio (or boost.aiso). Maybe it's the best framework for asynchronous operations in C++.

Abyx
do you know good example codes using asio lib (none boost)?
ok found this : http://sourceforge.net/projects/asio-samples/
@user63898: look in asio-1.4.5/src/examples/ or http://think-async.com/Asio/asio-1.4.5/doc/asio/examples.html
Abyx
what is the name of the example for none blocking ?
@user63898 http://think-async.com/Asio/asio-1.4.5/doc/asio/examples.html#asio.examples.nonblocking
Abyx
A: 

Of course you can. Why wouldn't you? In windows you can use the TcpListener class to do a non blocking accept with the BeginAcceptTcpClient method. http://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener.beginaccepttcpclient.aspx (Has example code)

RonaldV
It's C#, nor C++ nor C
Abyx
It's Visual C++ look at the last example on the web page.
RonaldV