from the main code i call a function to start a server on a port X,  already this server started , i back to main fucntion, make some calculus and after that i have to write some data through the socket, so i call a writing fuction, but to this fuction i have to pass to it the data i want transmit and something to indicate it what's the socket i'm using. I'm not an expert in programming so i dont know if this is the best way to do it. I just want to access to the variable socket from anywhere.
thanks

2010/1/27 Igor R <boost.lists@gmail.com>
> hi for the fast answer, i have other question respect to this, what about if
> i wanna a function return the socket descriptor value? what must be the type of value retuned? an int value?

You mean the low-level socket descriptor, which can be used in recv/send etc.?

asio::ip::tcp::socket::native_type
socketDescriptor(asio::ip::tcp::socket &socket)
{
 return socket.native();
}
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users



--
Ing Pedro Alonso Chaparro Valero
Ciudad Politecnica de la Innovación
iTEAM - Mobile Communications Group
Polytechnic University of Valencia
C\ Camino de Vera S/N, Edificio 8G
46022 Valencia, Spain