GithubHelp home page GithubHelp logo

tambapps / p2p-file-sharing Goto Github PK

View Code? Open in Web Editor NEW
26.0 26.0 10.0 2.91 MB

Peer to peer project to share files between two devices on a same local network

License: GNU General Public License v3.0

Java 69.65% CSS 0.11% Groovy 2.33% Batchfile 0.06% Shell 0.05% Kotlin 27.80%
android java javafx p2p peer-to-peer tcp udp

p2p-file-sharing's Introduction

p2p-file-sharing's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

p2p-file-sharing's Issues

File not found

Hello,

There are some files that are missing in this project. File named "FileData" and "SendingFileData" that is supposed to be located in "model" package.

Problem in build.gradle

When running code on android studio the line below has some error

def admobProperties = new Properties()
admobProperties.load(new FileInputStream(rootProject.file("admob.properties")))

p2p_library erroneously shows transfer-compelted notification if connection was lost in the process

Heya,
I am building an application on top of your peer-to-peer app on android and noticed that, if I disable wifi on my phone while it's looking for a connection, it displays the "Transfer completed" notification.
I fixed it by going into
p2p_library/src/main/kotlin/com/tambapps/p2p/fandem/task/SendingTask.kt

and adding
super.cancel()
in the catch-clause in send():

@Throws(IOException::class)
  fun send(fis: InputStream?, fileName: String,
           fileSize: Long) {
    try {
      createServerSocket(fileName).use { serverSocket ->
        serverSocket.accept().use { socket ->
          transferListener?.onConnected(peer, Peer.of(socket), fileName, fileSize)
          CustomDataOutputStream(socket.getOutputStream()).use { dos ->
            dos.writeLong(fileSize)
            dos.writeInt(bufferSize)
            dos.writeString(fileName)
            share(bufferSize, fis!!, dos, fileSize)
          }
        }
      }
    } catch (e: SocketException) { //socket closed because of cancel()
      super.cancel() // this one right here
    }
  }

Not sure if that is a fix or more like a workaround though...

Either way, I'm gonna take the opportunity to say thank you for this project, it's extremely useful!

PeerSniffer Class is missing

Hello,
appretiate the work and effort in this project.
however I run it I noticed that PeerSniffer Class is not there therefore it throughs some errors.

can you share that please.
thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.