using sockets by the fstream interface

Andrey Tkachuk ant@boy.univ.kiev.ua
Fri Dec 8 01:19:00 GMT 2000


>From ant Tue Nov 14 21:15:53 2000
Subject: using sockets by the fstream interface
To: bug-lib-g++@prep.ai.mit.edu
Date: Tue, 14 Nov 2000 21:15:53 +0200 (EET)
X-Mailer: ELM [version 2.4ME+ PL61 (25)]

Dear gurus, at first I want to ask you forgiveness for my english, because i'm
just an ukrainian...

So, when i developed the client/server progect, I wanted my server to be on C++
and use sockets.
I prefere to work with c++ standart iostream library and wanted to work with
sockets by fstream interface. But... it didn't work.
I've tried to work with sockets by standart C FILE interface: all was fine but
with C++'s fstream not. It didn't work only when program was alredy builded: on
the stage of compiling and linking all was fine. So, after the long period of
seeking bug it seems to me that i've found it. This was year ago and because of
this i can't explain why it works: the long period, and i have not time to
parse it again for explanation maby you as developers will understand this
little change. The contents of patch file is this:


--- libio/fileops.c	Wed Mar  1 15:51:02 2000
+++ fileops.c	Wed Mar  1 15:54:31 2000
@@ -258,7 +258,7 @@
        Instead, just indicate that offset (before and after) is
        unpredictable. */
     fp->_offset = _IO_pos_BAD;
-  else if (fp->_IO_read_end != fp->_IO_write_base)
+  else if (fp->_IO_read_end != fp->_IO_write_base && fp->_offset != _IO_pos_BAD)
     {
       _IO_pos_t new_pos
 	= _IO_SYSSEEK (fp, fp->_IO_write_base - fp->_IO_read_end, 1);


That's all! My only goal is to improve your soft for my soft will work by
compiling on other mashines with your new perfect gcc :)

Thank you very mutch for attention.
My best regards.
PS: If you please, reply me with results of inspection of this problem.
  Andrey Tkachuk
  ICQ: 77275730
--
15 ÎÏÑ 	Niagara Falls power plant startup, 1896


More information about the Gcc-bugs mailing list