You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Itay Eliaz <it...@TTI-TELECOM.COM> on 2002/04/24 19:02:43 UTC

TCP socket InputSource

Hi,

I'm trying to implement an InputSource based on a TCP socket for the
XMLparser.
I do this since my connection is not HTTP, and therefore I can't use the
URLInputSource.
To do this I derived from the InputSource and BinInputStream classes.
My problem is the document ends but the socket is still open and the parser
hangs.
In my implemetation of the BinInputStream::readBytes method, the whole
document is read, but in the next method call it hangs since it didn't reach
maxToRead nor EOF.

unsigned int BinInputStream::readBytes(XMLByte* const  toFill,
                                  const unsigned int maxToRead)
{
 unsigned int received = _s.recv(_socket, (char *)toFill, maxToRead);
 _count += received;
 return received;
}

unsigned int BinInputStream::curPos() const
{
	return _count;
}

If I break the connection BinInputStream::readBytes will get EOF and problem
solved,
but I can't break the connection since I'm wating for a response.

Any Ideas ?
Thanks,
Itay

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org