dnode-php icon indicating copy to clipboard operation
dnode-php copied to clipboard

Alternate Scheme Support for Client

Open astephens25 opened this issue 12 years ago • 5 comments

I wanted to use the client with SSL and found DNode very difficult to extend so I added the support directly. The parsing of the scheme argument to the connect method is a bit odd, but was need to maintain compatibility with existing calls.

The new Connection class is simply to perform buffered IO on the stream as required by various wrapper streams, but leave the raw IO enabled for UDP (and TCP just to change as little as possible).

The use case for these changes is to have a client connect over SSL to a server wrapped with stunnel. Cheers.

astephens25 avatar Mar 22 '13 01:03 astephens25

I've given this some thought, and UDP really does not fit with the current stream-oriented implementation of things. Thoughts? Can you rework/simplify the patch based on that?

igorw avatar Apr 21 '13 22:04 igorw

Sorry it took me so long to get back to this. I agree on the removal of UDP. A missing packet from a connectionless stream would indeed be a problem for this application. I would be happy to simplify these modifications.

While using my modified version, I discovered an issue with the buffered reads when the read size I will go ahead and make the additional corrections for this as well.

astephens25 avatar May 14 '13 18:05 astephens25

All tests are passing. I made some modifications to the argument parsing in Protocol you may want to examine. I am using the code right now and everything seems to be working as intended.

I did not remove UDP per se, but I did remove any special code required to make it function. The documentation seems to indicate the normal socket client can open a UDP stream the same was as any other protocol, but there may be unforeseen issues with the "connection" lifecycle.

astephens25 avatar May 15 '13 00:05 astephens25

Just figured out a deeper issue here. dnode-php is using React\Socket\Connection which is really made for server connections. A React\Stream\Stream (which uses fread) should be used instead. In fact, SocketClient provides one. So #26 would be a cleaner fix for this problem.

igorw avatar Jul 08 '13 18:07 igorw

After forking, when run composer install or update followings error throws:-

  • A typo in the package name
  • The package is not available in a stable-enough version according to your minimum-stability setting

? to do PLease!!

rajesh41 avatar Jun 30 '17 11:06 rajesh41