kirillzyusko / react-native-wifi-p2p

Library that provide access for working with wi-fi direct (p2p) module in android.
174 stars 32 forks source link

sendFile and receiveFile refactoring #81

Open viniciuscb opened 1 year ago

viniciuscb commented 1 year ago

Do the same refactoring as it was done with sendMessage and receiveMessage.

See:

viniciuscb commented 1 year ago

@kirillzyusko what do you think about changing the socket listening to files to port 8989, instead of the port 8988? We are using 8988 for message already...

(of course this would break backward compatibility, as peers using old library versions could not send files to peers with new library versions....)

kirillzyusko commented 1 year ago

@viniciuscb Well, I think it's a good suggestion! What do you think about next approach - use 8988 for now and submit PR with this port, then create a release 3.5.0 And after 3.5.0 create 4.0.0 and introduce some breaking changes:

viniciuscb commented 1 year ago

That seems fine! By now, I have no more ideas.

viniciuscb commented 1 year ago

I think we should update the documentation. For instance, the sendMessage() instructions in readme worked for me a bit differently.

It is not necessary anymore to create a group / be the owner of the group to send and receive messages. More than that, here in my tests (and the tests of my team) it was not possible to create a group (the android system gives me a "resource busy" message) and not even start as group owner with connectWithConfig .

It seems that a groupOwner is chosen randomly by android, but it haves some criteria: here everytime my newest mobile device was elected to be the groupOwner, the same for tests with my teammates.

seba9999 commented 1 year ago

Hey folks ! I've been busy the last few monthes but I'm planning on trying again broadcast with RN !

@viniciuscb You're saying that it's not necessary to create a group anymore ... But how do you manage to have the "first" adress to send message then ? Which actions are mandatory to connect 3 (or more) devices and then each user could brodcast to everybody ?

Would you be kind enough to share some bootstrap code ? 😇

@kirillzyusko What about that v4 ? 🚀 Would be so nice !

I would suggest instead of message/file toggle to set data field ?

kirillzyusko commented 1 year ago

@seba9999 I can create v4 if needed - don't be afraid to make breaking changes, but also be sure that you know steps for migration from v3 to v4 🙂