-
-
-
-
system/libraries/network/class.streamsocketclient.inc.php (Diff revision 1) This needs to implement HttpRequestInterface
[Network] add stream socket client class
Review Request #10 — Created Nov. 5, 2012 and discarded
Information | |
---|---|
olivier | |
Lunr | |
personal/olivier/streamclient | |
12249 | |
Reviewers | |
lunr | |
Add StreamSocketClient class extending StreamSocket implements all abstract methods from StreamSocket
PHPUnit tests passed Live test for push to APNS
- 1
- 0
- 8
- 0
- 9
Description | From | Last Updated |
---|---|---|
I don't like this line, there's way too much going on | pprkut |
Change Summary:
Implements the HttpRequest interface in StreamSocketclient class Live test made but no unit test written for the moment. Need advice for: 1-Now the class handles http, maybe moving all the parameters of constructor to setters with fluid interface would be relevant. In such case, while using http post or get, the remote socket value could be generated from the uri given as parameter to the methods involved 2-Despite the fact as far as I have seen, I put the response header data in an array and makes the key and values lower case doesn't really matter but I had like you to be aware of that. 3-I forced the http header parameter to close (Connection: close) for both post and get requests. This is probably no good design but the keep-alive value generates time out or other weird behaviours probably because rejected by remote servers. 4-I intend to add a last method to the class: a method that would register a libevent event wrapper to the stream It would consist in simply making the StreamSocketClient class provide its handle to the wrapping event class This is better practice I think than just adding a get_handler method to the class. this would involve the fact that extra classes should be created (event wrapper and base wrapper). Enjoy!
Change Summary:
Just fixed a potential bug in chunk support for transfer-encoding in parse_http_response_data. For commenting please see remarks of previous diff.
Diff: |
Revision 3 (+3403 -10)
|
---|
-
There's changes in this review that are already present in other review requests. Please rediff properly.
Change Summary:
rediffed referring to the fact that parent review is stream socket. For commenting please refer to diff r2 comments.
Diff: |
Revision 4 (+1550 -5)
|
---|
-
-
system/libraries/network/class.streamsocketclient.inc.php (Diff revision 4) why would I be interested in this?
-
-
system/libraries/network/class.streamsocketclient.inc.php (Diff revision 4) we don't need the line breaking here
-
system/libraries/network/class.streamsocketclient.inc.php (Diff revision 4) Instead of checking whether this is a handle, you can just introduce a boolean and check whether that is TRUE or FALSE
-
system/libraries/network/class.streamsocketclient.inc.php (Diff revision 4) superfluous, look at parse_url()
-
system/libraries/network/class.streamsocketclient.inc.php (Diff revision 4) I don't like this line, there's way too much going on