Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added ObexListenerContext(Stream rs) for Android file transfer #356
base: obex-development
Are you sure you want to change the base?
added ObexListenerContext(Stream rs) for Android file transfer #356
Changes from all commits
e434a29
55239b1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to add the existing request header here? - because the responseHeaders should contain the headers as sent by the remote device along with the retrieved file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When sending the file I set the user defined header request.Headers.Add("ContentMd5", md5); ("ContentMd5" would change to "User0" with your new changes) before calling request.GetResponse(); The call to GetResponse() then creates responseHeaders as a new WebHeaderCollection() instance effectively wiping out the previously set user defined header. Other headers are added in ObexWebRequest:DoPut(); With your new user defined headers where would we set them when sending a file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will wait until I find out how to set a user defined header so I can implement and test before resubmitting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have not commented about public ObexListenerContext(Stream rs) with a stream parameter instead of socket, what are your thoughts about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I've been distracted and forgot to follow up on this. Now that the listener can work from either a stream or a socket, I don't think the public constructor is needed because this can be created through the normal listener flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see where you test for socket == null in ObexListenerContext at line 257 and assign stream on line 259 but this is not used. Line 283 says "// call to stream implementation to go here" so there is no ObexListenerContext returned. So this does not seem to be any further ahead with regard to getting the ObexListenerContext "through the normal listener flow". My other issue is that I have to use BluetoothListener rather than ObexListener because I need to set a custom service GUID. It would be great if we could pass a custom GUID to the BluetoothListener constructor. This is why I created the public ObexListenerContext constructor which took a stream argument. I want to use ObexListenerContext but also need a custom service GUID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, then it should expose the public constructor for those cases. There is definitely scope for more flexibility in the listener so it can support custom services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will you be making changes to support custom services and when would you expect to include them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think based on time available to this at the moment we assume that it won't happen soon. It'll possibly require work to both the BluetoothListener and ObexListener to fully support.