Граф коммитов

177 Коммитов

Автор SHA1 Сообщение Дата
moozzyk bc43ddf57d Shameless(negotiate)Plug - plugging in sending negotiate request when starting a connection
Bonus changes:
- renaming some variables for consistency
- removing trailing whitespaces
2014-11-15 01:22:38 -08:00
moozzyk 78ee26b990 ILogStuff - enabling logging from `connection_impl` and transports
Note that a side effect of this change is that we now will be able to raise events from transports since transports now will have a (smart) pointer to the connection_impl instance.
2014-11-15 01:21:28 -08:00
moozzyk ac5a9e0a4d SmartPimpl - changing m_pImpl from a raw pointer to `std::shared_ptr` 2014-11-15 01:16:10 -08:00
moozzyk db0e8709cc PurePollution - changing the way we inject factories
Before we would create factories in the `connection` class and pass references to them when creating the `connection_impl` instance. In the long run this won't work for at least couple of reasons:
- transports will have to have a reference to the `connection_impl` to be able to let connection know about events (e.g. message received, disconnected, error etc). As a result to create a transport a (smart) pointer to the `connection_impl` will have to be passed to the `transport_factory.create()` method. However this would require making the `connection_impl type` (and all types it uses) public because the factories are members of a public (i.e. the `connection`) type. An alternative is to use uniqe pointers which will be set to default factories in the `connection_impl` itself. Tests will still be able to inject their own implementation. An additional advantage of using pointers is that now we can hide a few types that were only exposed because we had references in the connection class and since the references are gone the types don't have to exposed anymore.
- because transports will have to have a back pointer to a `connection_impl` instance it will be possible that the `connection_impl` instance will outlive the `connection` object itself (think about tasks that captured a pointer to `connection_impl` and that running after the `connection` object goes out of scope). In this scenario the transport/`connection_impl` may want to use factories while they were already destroyed because they were members of an object that has already been destroyed. This would result in undefined behavior and most likely a crash. Moving factories to the `connection_impl` fixes this issue (note: currently the `connection` type holds a raw pointer to a `connection_impl` instance which is `delete`d in the `connection`'s dtor; this will have to be changed (most likely by changing the raw pointer to a smart pointer) to prevent from trying to use an already disposed pointer in transports - same as above)
As a result of this change we are 'polluting' the code base with smart pointers but the public surface is cleaner than before.
2014-11-15 01:05:12 -08:00
moozzyk 8030191c84 ILog - adding a logger class and a simple implementation for log writer 2014-11-11 18:36:18 -08:00
Pawel Kadluczka 3b4869c4d9 ThisWasTheProblem - websocket_transport no longer captures this pointer
Capturing `this` pointer in task lambdas is problematic because the task may run after the object gets out of scope or is destructed. The websocket transport tasks were rewritten to not capture `this` pointer anymore. In the future in cases where we need to be able to access members of `this` we will pass it as a smart pointer.
2014-11-11 18:26:29 -08:00
Pawel Kadluczka 41838a9d81 GettingStarted - taking care of connection_state when starting connections 2014-11-08 09:17:21 -08:00
Pawel Kadluczka 7d190aedf4 SignalrNativeClientAndTheTemplateOfDoom - untemplating websocket_transport
casablanca websocket_client returns websocket_incoming_message. However because there is no way to set the websocket_incoming_message response contents externally testing scenarios where messages were received was not possible. To make the code testable we would have to change the template type to something that returns pplx::task<utility::string_t> instead of pplx::task<websocket_incoming_message> which meant we could not use the casablanca websocket_client directly as the template type which was the main point of using the template in the first place. As a result the static polymorphism (i.e. template) is being replaced with runtime polymorphism (base pure virtual class).
2014-11-08 09:07:04 -08:00
Pawel Kadluczka 3c5d449a70 Disconnected - adding connection_state. 2014-10-31 16:18:10 -07:00
moozzyk 567a9431e4 Break-Up[Explicit] - clean up/refactoring
- moving url and querystring from connection to connection_impl
- marking ctors with 1 mandatory parameter as explicit to prevent from implicit conversions
- moving implementations from headers to cpp files

No functional changes
2014-10-31 14:53:18 -07:00
Pawel Kadluczka 73e6e54d29 Release - making the release configuration compile
Note: these are just basic changes for the already exisiting Release|Win32 configuration. we will need to rethink and consolidate the build when we start buildning for other architectures/platforms
2014-10-31 10:30:49 -07:00
moozzyk efd80006c2 TransportModelT - creating websocket transport in transport_factory 2014-10-30 21:15:59 -07:00
moozzyk 68475cb441 AlmostTemplateFreeWorld - replacing compile time polymorphism with runtime polymorphism
Leaving templates in the websocket_transport
2014-10-30 21:12:59 -07:00
moozzyk 1a9488627d CommonTransport - creating a transport interface 2014-10-28 13:19:46 -07:00
moozzyk 8afd2dcd91 PimplyConnection - adding basic connection implementation. 2014-10-27 16:38:42 -07:00
moozzyk 6f089a3934 WCF (Websocket Communication Foundation) - a skeleton for websocket transport 2014-10-27 14:45:00 -07:00
moozzyk 05101d3f68 Connect - enabling building connect request url 2014-10-27 14:11:11 -07:00
moozzyk 54495c9136 HttpForReal - implementing web_request sending real http requests 2014-10-27 14:09:58 -07:00
moozzyk 5e30109a3e RockBottomOffer - implementing negotiate request 2014-10-27 12:12:09 -07:00
moozzyk 0c890e2190 10/13/2013 - IndustrialEraStarted - adding a web request factory 2014-10-13 20:19:14 -07:00
Pawel Kadluczka 841da2b6e6 007 - setting user agent header 2014-10-13 20:14:59 -07:00
Pawel Kadluczka ff6600ca68 HisResponseWasExceptional - throwing exception for non-200 web responses 2014-10-13 20:10:31 -07:00
moozzyk a094146f6a NoOneIsIrreplaceable - creating a basic http communication layer that can be replaced in tests or by end users. 2014-10-13 10:53:52 -07:00
moozzyk 8ab6ff7829 CopyRighteous - adding copyright headers, minor cleanup 2014-09-30 10:13:47 -07:00
moozzyk a6c6c5335b Building negotiate request relative uri. 2014-09-30 10:12:18 -07:00
moozzyk 22de2f51ce EveryJourneyHasAFirstStep - initial project layout. 2014-09-25 16:37:24 -07:00
moozzyk f724e97c90 Initial commit 2014-09-25 08:32:03 -07:00