   boost::asio errors
  the question is how can i convert this `boost::asio::async_read(socket_,boost::asio::buffer((char*)buffer, 1000),boost::bind(&Connection::Receive, this,  boost::asio::placeholders::error));` to int so i can check if i recived something?#ifndef _CONNECTION_H_#define _CONNECTION_H_#include <boost/bind.hpp>#include <boost/shared_ptr.hpp>#include <boost/enable_shared_from_this.hpp>#include <boost/asio.hpp>#include <stdint.h>class Connection {public:Connection(boost::asio::io_service& io_service);~Connection();boost::asio::ip::tcp::socket& socket(){return socket_;}void Send(uint8_t* buffer,int length);bool Receive();protected:virtual void OnReceived(uint8_t* buffer, int len) = 0;private:boost::asio::ip::tcp::socket socket_;};#endif--------------------------------------------------------------------------------------------------#include "Connection.h"Connection::Connection(boost::asio::io_service& io_service): socket_(io_service){}Connection::~Connection(){}void Connection::Send(uint8_t* buffer,int length){boost::asio::async_write(socket_,boost::asio::buffer(buffer,length),boost::bind(&Connection::Send, this,boost::asio::placeholders::error));}bool Connection::Receive(){uint8_t* buffer = new uint8_t[1000];int recvlen = boost::asio::async_read(socket_,boost::asio::buffer((char*)buffer, 1000),boost::bind(&Connection::Receive, this,  boost::asio::placeholders::error));if (recvlen <= 0) {delete[] buffer;return false;}this->OnReceived(buffer, recvlen);delete [] buffer;    return true;}errors:Error1error C2825: 'F': must be a class or namespace when followed by '::'e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp69Error2error C2039: 'result_type' : is not a member of '`global namespace''e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp69Error3error C2146: syntax error : missing ';' before identifier 'type'e:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp69Error4error C2208: 'boost::_bi::type' : no members defined using this typee:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp69Error5error C1903: unable to recover from previous error(s); stopping compilatione:\boost_1_46_1\boost_1_46_1\boost\bind\bind.hpp696IntelliSense: a value of type "void" cannot be used to initialize an entity of type "int"d:\c++\ugs\common\connection.cpp187IntelliSense: the #endif for this directive is missingd:\c++\ugs\common\connection.h18IntelliSense: this declaration has no storage class or type specifierd:\c++\ugs\common\connection.h26whats wrong and how can i fix it thanks  i appreciate it.   
whats wrong and how can i fix it thanks  i appreciate it.You have angered the ancient gods. The evil has been awoken...to int so i can check if i recived something?[/quote]You can't, the call is asynchronous.The result will be received in your callback OnReceived. The len there will be how much has been read.See the tutorial on how to pass the recv parameters properly, I think your call is missing the length parameter, it only has error.;You have angered the ancient gods. The evil has been awoken...ahahah LOL You can't, the call is asynchronous.The result will be received in your callback OnReceived. The len there will be how much has been read.See  the tutorial on how to pass the recv parameters properly, I think your  call is missing the length parameter, it only has error.aha I C, okey can you link me to the Tut. thnx for your answer ;  Just the calls.Basic overview.The rest.;Just the calls.Basic overview.The rest.thnx i appreciate it.the calls link u send me is for UPD is it the same for the TCP?and it's an asynchronous while i needs it asynchronous coz it's a server for a gameserver ;and it's an asynchronous while i needs it asynchronous coz it's a server for a gameserver Actually, the list of the tutorials talks about sync and async TCP and UDP, so you can find what you need right there: http://www.boost.org/doc/libs/1_46_0/doc/html/boost_asio/tutorial.htmlAll the functions are documented in the reference: http://www.boost.org/doc/libs/1_46_0/doc/html/boost_asio/reference.htmlIf you know C++, and understand asynchronous/event-driven/callback-based/reactor-style programming (many names for the same thing), boost::asio can serve your C++ networking needs very well.   