|
Forums -> Security Library Forum
|
by Angel Todorov [atodorov at acm dot org] posted on 2003/11/12 |
|
Hello,
i have recently tried to use the Seek() method from the SecureStream, but it is apparently not implemented, since it throws a NotSupportedException. Is there any possibility it will be included in future releases? |
by Pieter Philippaerts [Pieter at mentalis dot org] posted on 2003/11/12 |
|
What exactly would the Seek method do on a SecureNetworkStream?
Like the System.Net.NetworkStream, you cannot use the seek method of the SecureNetworkStream due to the fact that a Socket doesn't support random access, only sequential access. |
by Ishpal Singh [ishpal dot singh at aeye dot net] posted on 2003/11/13 |
|
Trying to use the mentalis lib with Npgsql driver. And get an unhandled exception of type 'System.NotSupportedException' occurred in org.mentalis.security.dll when trying to open the database connection.
I can see it connected to the server but it throws the exception at the point when reading data.
The following call sequence might help.
internal sealed class NpgsqlQuery{
.....
public void WriteToStream( Stream outputStream, Encoding encoding ){
outputStream.WriteByte((Byte)'Q');
....
}}
-----------------------------------------
namespace Org.Mentalis.Security.Ssl {
public class SecureNetworkStream : Stream {
........
public override long Seek(long offset, SeekOrigin origin) {
throw new NotSupportedException();
}
........
}
|
by Pieter Philippaerts [Pieter at mentalis dot org] posted on 2003/11/13 |
|
If Npgsql uses the SecureNetworkStream.Seek method, then it's normal that a NotSupportedException occurs. Seek is not supported and will not be supported in the future. It's not a bug, but a design decision. The reason why it's not implemented is because a socket (unlike a file, for instance) does not support random access.
The outputStream.WriteByte method does not use the Seek method, so it's unlikely that the error occurred from that call. |
|
|