Tcpsocket::write question
Mikael Magnusson
mikma264 at gmail.com
Tue Oct 31 11:39:28 CET 2006
Philippe Torrelli wrote:
> Hello,
>
> Trying to understand what the define
> _MSC_VER
> Is for in:
>
> int32_t TCPSocket::write(string data){
> #ifdef _MSC_VER_
> return ::_write(fd, data.c_str(), (unsigned int)data.length());
> #else
> return ::send(fd, data.c_str(), data.length(), 0);
> #endif
> }
>
> Here, in TCPSocket::write(string data)
> The ::_write thing makes crt throws assertions
> when built with visual studio 2005 ..
> ( but with ::send minisip works )
> Is it for windows CE, for mingw, or just obsolete ?
>
I suppose it's for compilation on any C++ compiler from Microsoft. At
least it's not for mingw.
> I just did simple tests with textui, I don't think I stepped
> in a scenario where the copy constructor was used before the
> write is done so maybe it's related ..
>
>
> Also noticed that it's not coherent with
>
> int32_t TCPSocket::write(const void *buf, int32_t count){
> return ::write(fd, buf, count);
> }
>
Maybe this method isn't used in minisip?
Mikael
More information about the Minisip-devel
mailing list