1723 Commits

Author SHA1 Message Date
drieseng 5f6c3b0bc7 Fix SL build. 2016-11-03 21:30:17 +01:00
drieseng 13fff36135 Added support domain name address type for SOCKS5.
Fixes issue #98.
2016-11-03 21:23:43 +01:00
drieseng 5a1e469bb9 No longer throw ObjectDisposedException in Stop() when port is disposed. 2016-11-03 20:42:46 +01:00
drieseng f50b9f18a6 Do not allow simultaneously sending of a packet and disposing of the session.
Fixes variant of issue #32.

Impact on performance still needs to be checked, so we may revert this later.
2016-10-06 21:23:52 +02:00
drieseng 009fbc39eb Revert "Attempt to use MSBuild project file to build."
This reverts commit 1e4b0f1ee1.
2016-10-04 21:19:53 +02:00
drieseng 1e4b0f1ee1 Attempt to use MSBuild project file to build. 2016-10-04 21:11:17 +02:00
drieseng 7a474e6472 Remove CancelConnectAsync - which is .NET 4.0+ only - as dispose of the socket has the same effect. 2016-10-03 21:03:10 +02:00
drieseng 93874699e4 Cancel async connection request when timeout has elapsed.
Dispose all managed resources.
Fixes issue #87.
2016-09-22 21:10:12 +02:00
drieseng 1711d5a3b5 Merge branch 'develop' of https://github.com/sshnet/SSH.NET.git 2016-09-21 21:30:06 +02:00
drieseng 852efaf9f9 Modify SocketAbstraction.CanWrite to return false when socket is null. 2016-09-21 21:29:59 +02:00
Gert Driesen 647d3ffd3f Remove obsolete partial Session classes and sync project files. 2016-09-19 21:59:32 +02:00
Gert Driesen 939325ee64 Merge pull request #88 from sshnet/master
Move back to use develop branch.
2016-09-19 21:36:11 +02:00
drieseng cddeed3a7a Fixed warning. 2016-09-19 21:34:59 +02:00
drieseng a6eedcb4f4 Session is no longer partial. 2016-09-18 19:27:15 +02:00
drieseng c0b22818c2 Sync project files with Session simplification. 2016-09-18 19:26:36 +02:00
drieseng ee9f0f748a SocketExceptions that are thrown during shut down of the socket should not bubble up.
Fixes PR #86.
2016-09-18 19:17:04 +02:00
drieseng f9773a6786 Refactor out use of dynamic types, and reflection for processing received SSH messages. 2016-09-18 19:08:12 +02:00
drieseng 97ed0ddb1c Dereference socket instance field before disposing it. 2016-09-18 11:16:44 +02:00
drieseng 3e0100272c Dereference waithandle instance field before disposing it. 2016-09-18 11:16:10 +02:00
drieseng 9f67d3d7eb Log raised exception. 2016-09-17 09:39:38 +02:00
drieseng 6237dd4982 Move IsSocketConnected to Session.cs.
Move HandleMessageCore to Session.cs, and use FEATURE_DYNAMIC_TYPE conditional compilation symbol to use dynamic code.
2016-09-15 21:23:58 +02:00
drieseng 536f9bd2a4 Use Socket.IsConnected() extension method. 2016-09-15 21:21:56 +02:00
drieseng 9e8ce4a868 Modify ReceiveMessage to return null when connection is closed.
Added TrySocketRead method that returns 0 (zeo) when connection is closed.
Remove SocketRead(int length) overload.

Added IsConnected extension method to Socket.
Modify MessageListener() to use this extension method as condition for the message loop.
Do not bother checking readSockets as the connected check of the socket allows us to combine both the connection closed and socket disposed conditions.
2016-09-13 21:26:49 +02:00
drieseng b3d24ef8bd Harden dispose. 2016-09-13 21:19:23 +02:00
drieseng 7f2edeb55f Fix "randomness". 2016-09-12 21:40:28 +02:00
drieseng 33c834ddec Sync .NET 3.5 test project file with .NET 4.0 test project. 2016-09-12 21:18:52 +02:00
drieseng ad596e83c0 Remove clearing of buffer. 2016-09-11 21:29:30 +02:00
drieseng edde414ef3 Since Dispose now also invokes Disconnect, we no longer need to explicitly invoke Disconnect. 2016-09-11 21:09:50 +02:00
drieseng 3bd1b4eec0 Modify tests to take into account fact that we no longer explicitly disconnect the SftpSession, but instead immediately dispose it. 2016-09-11 20:46:54 +02:00
drieseng 35c9ecfd56 Revert to previous code as its a little more clear. 2016-09-11 20:45:51 +02:00
drieseng 3cf6979943 Avoid NRE when disconnecting or disposing. 2016-09-11 20:21:27 +02:00
drieseng 76fdef9d72 Avoid NRE when disposing. 2016-09-11 20:20:55 +02:00
drieseng b2d95d2b7f Dereference _channel first. 2016-09-11 20:20:20 +02:00
drieseng 800fd3fe99 Use c# type keywords. 2016-09-10 21:15:33 +02:00
drieseng ba59196821 Minor improvements. 2016-09-10 21:11:40 +02:00
drieseng 3808aae801 Avoid extra IsOpen invocation when attempting to open channel session. 2016-09-10 19:40:09 +02:00
drieseng bb968f5550 Minor doc corrections. 2016-09-10 19:38:57 +02:00
drieseng 1d6177fceb Send SSH_MSG_CHANNEL_EOF and SSH_MSG_CHANNEL_CLOSE in synchronized block.
Fixes issue #84.

Eliminate public Close() method and its use within SSH.NET.
Remove wait bool from protected Close(bool) method.
The protected Close() method will now always wait for a  SSH_MSG_CHANNEL_CLOSE if the client initiated closing the channel.
2016-09-10 18:55:03 +02:00
drieseng b413970148 Added more tracing, and break receive loop when we start disconnecting. 2016-09-08 21:45:47 +02:00
drieseng 4632a33e43 Increase timeout waiting for buffered read data. 2016-09-08 21:45:06 +02:00
drieseng 1bab13b78d Add comment. 2016-09-07 21:40:03 +02:00
drieseng e9807ef3f8 Fix doc to correspond with new implementation. 2016-09-07 21:34:36 +02:00
drieseng 77e7bc8c04 Do not catching exceptions while clearing read buffer of socket.
Leave this up to the caller.
2016-09-07 21:34:12 +02:00
drieseng c274f1f9b5 Catch and log SocketException that is thrown while shutting down the socket or clearing its read buffer.
Always log raised exception, even if we're disconnecting.
2016-09-07 21:33:41 +02:00
drieseng 879c39badd Rename SendDisconnect to TrySendDisconnect. 2016-09-07 20:10:45 +02:00
drieseng f2a8d0ff75 Fix test after refactoring. 2016-09-06 19:57:32 +02:00
drieseng 395bbe70d6 Only use Socket.Poll, Socket.Select and read lock when FEATURE_SOCKET_POLL is defined.
Added test for SSH server shutdown while we're reading the packet.
2016-09-05 23:10:34 +02:00
drieseng f9ad89384f Rename Read(int length) to SocketRead(int length)
Introduce dispose lock to resolve race condition in IsConnected/IsSocketConnected.
Rename _socketLock to _socketWriteLock
Eliminate extra allocations in ReceiveMessage, and combine two socket reads.
Use separate lock to eliminate race condition in IsSocketConnected between Poll and checking the Available property.
Modify SocketRead(int length, byte[] buffer) to also take offset.
Modify MessageListener to use Select instead of blocking Receive.

Fixes issue #80.
2016-09-04 21:20:19 +02:00
drieseng 6a1859c500 Added Decrypt overload taking offset and length. 2016-09-04 20:57:15 +02:00
drieseng ad3de364fd Added Pad overloads taking offset and length. 2016-09-04 20:52:23 +02:00