If you have a patch to suggest to test for this or an alternate implimentation, I would look at including it. I don't have access to a sun box at the moment...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2001-05-09
Hello, I have been looking at the
GNU iostream and the MS dev. network help, and
the only streambuf method that seems to do
something similar to setb is setbuf, but it only
works for the first allocation. I am not sure
if this will work, but below I post a patch that
Alwyn could test in order to know if
setbuf works fine on solaris and forte.
BEWARE: I am not sure if this does what it should
do, it is only a possible solution. I can only
assure that it compiles on Debian unstable.
int TCPStream::doallocate()
--- 875,887 ----
Error(SOCKET_RESOURCE_FAILURE);
return;
}
bufsize = size;
clear();
! // WARNING, do not use setb(gbuf, gbuf + size, 0); it is not
! // defined in forte c++
! setbuf(gbuf, size);
setg(gbuf, gbuf + size, gbuf + size);
setp(pbuf, pbuf + size);
}
int TCPStream::doallocate()
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The question is one of reallocation. A simple test would be to use a TCPStream and use open and close multiple times, each time with a different size buffer as the second argument. I would like to know how this works and will take it in as a patch as soon as it's verified.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2001-05-10
Hi, there is already such test application inside the demo/ dir; look for `tcpthread'. the patch concerns TCPStream class, that is inherited
by TCPSession that in turn is used by tcpthread.
Take into account that those demo apps are not ussually compiled, you have to go there and
explicitly type make.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Is it possible to patch the common-c++ code to make provision for this.
How would one replace the functionality of setb in the code?
If you have a patch to suggest to test for this or an alternate implimentation, I would look at including it. I don't have access to a sun box at the moment...
Hello, I have been looking at the
GNU iostream and the MS dev. network help, and
the only streambuf method that seems to do
something similar to setb is setbuf, but it only
works for the first allocation. I am not sure
if this will work, but below I post a patch that
Alwyn could test in order to know if
setbuf works fine on solaris and forte.
BEWARE: I am not sure if this does what it should
do, it is only a possible solution. I can only
assure that it compiles on Debian unstable.
*** CommonC++-1.4.2/posix/socket.cpp Sat Mar 31 17:21:13 2001
--- CommonC++-chapuzas/posix/socket.cpp Tue May 8 22:05:05 2001
***************
*** 875,885 ****
Error(SOCKET_RESOURCE_FAILURE);
return;
}
bufsize = size;
clear();
! setb(gbuf, gbuf + size, 0);
setg(gbuf, gbuf + size, gbuf + size);
setp(pbuf, pbuf + size);
}
int TCPStream::doallocate()
--- 875,887 ----
Error(SOCKET_RESOURCE_FAILURE);
return;
}
bufsize = size;
clear();
! // WARNING, do not use setb(gbuf, gbuf + size, 0); it is not
! // defined in forte c++
! setbuf(gbuf, size);
setg(gbuf, gbuf + size, gbuf + size);
setp(pbuf, pbuf + size);
}
int TCPStream::doallocate()
I will try the patch as soon as possible.
I have not actually used common-c++ yet so if someone could maybe provide some code that will test whether the patch operates correctly?
The question is one of reallocation. A simple test would be to use a TCPStream and use open and close multiple times, each time with a different size buffer as the second argument. I would like to know how this works and will take it in as a patch as soon as it's verified.
Hi, there is already such test application inside the demo/ dir; look for `tcpthread'. the patch concerns TCPStream class, that is inherited
by TCPSession that in turn is used by tcpthread.
Take into account that those demo apps are not ussually compiled, you have to go there and
explicitly type make.