nice to see you. I hope you enjoyed your vacation.
Patch 12352 should be deleted because not working.
The following two patches should be applied:
- in the SocketConnect method, after the EndConnect method, I added some validation code to determine whether the socket is still connected or not. If no data is available within 2 seconds, an exception is raised. (*)
- In the SocketReadLine method, if the server returns zero, it starts an infinite loop. To fix that, I have replaced all of the code of this method with a single call to the "NetworkStream.ReadLine" which already handle in an excellent way the reading of
lines from a provided stream. It is also supposed to be faster because does not read a byte at a time like was doing the old method (plus all the additional checks).
- IsConnected property returns always true even when the socket is disconnected.I added a further check which check whether the server is still connected or not. (*)
(*) This methods are only reliable when the server close/reset/terminate the connection "gracefully". Unplugged network/power cable won't be noticed. Making a nonblocking, zero-byte Send call is the preferred method because detect any kind of disconnection.
I originally tried this implementation, but without success. Maybe unlike me you are able to implement this technique?
There are a few questions I would like to make:
1- I have seen that the library has an ASCIIEncoding class. Is there a particular reason on why you didn't use the already excellent ascii encoding available in the framework?
2-There are situations where an user (like me for example) only connects to a lan ssh server and don't need security but pure performance. I tried to implement the arcfour cipher (which appear to be the faster one), but the new version of the library stores
all of the ciphers in the new CipherInfo class which requires the CipherMode (not supported from the Arcfour encrytion).