Skip to content
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

initBook failed #190

Closed
sumanabhi opened this issue Apr 27, 2018 · 4 comments
Closed

initBook failed #190

sumanabhi opened this issue Apr 27, 2018 · 4 comments

Comments

@sumanabhi
Copy link

04-27 14:01:43.270 24223-24223/com.example.app E/FolioActivity: initBook failed java.net.BindException: bind failed: EADDRINUSE (Address already in use) at libcore.io.IoBridge.bind(IoBridge.java:99) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:139) at java.net.ServerSocket.bind(ServerSocket.java:335) at java.net.ServerSocket.bind(ServerSocket.java:295) at fi.iki.elonen.NanoHTTPD$ServerRunnable.run(NanoHTTPD.java:1761) at java.lang.Thread.run(Thread.java:818) Caused by: android.system.ErrnoException: bind failed: EADDRINUSE (Address already in use) at libcore.io.Posix.bind(Native Method) at libcore.io.ForwardingOs.bind(ForwardingOs.java:56) at libcore.io.IoBridge.bind(IoBridge.java:97) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:139)  at java.net.ServerSocket.bind(ServerSocket.java:335)  at java.net.ServerSocket.bind(ServerSocket.java:295)  at fi.iki.elonen.NanoHTTPD$ServerRunnable.run(NanoHTTPD.java:1761)  at java.lang.Thread.run(Thread.java:818)

After integrating this in my application i am getting this error.

@king3224
Copy link

king3224 commented May 4, 2018

Hi,I met the same problem today,have you solved this problem?if solved,can you tell me the solution?thanks

@mahavir155
Copy link
Contributor

mahavir155 commented May 4, 2018

@king3224 @abhi08singh All parsing is handle by r2-streamer which runs light weight server on device and uses port number 8080 by default.. If some other process is already using port 8080, then above issue might come..
In that case, you can use different port number by using following method to open book:
public FolioReader openBook(String assetOrSdcardPath, Config config, int port)

It will use the port number you provided.

@king3224
Copy link

king3224 commented May 4, 2018

oh,I got it ,thanks

@nuwanchamara
Copy link

nuwanchamara commented Aug 21, 2018

I tried different port numbers but it not working (In samsung J7) . But it works on ther devices like Xiomi redmi3 , Moto G5 and Huwawi devices (With default port). I seems like port number i passed is not using.

hrishikesh-kadam added a commit to codetoart/FolioReader-Android that referenced this issue Nov 29, 2018
Fixes FolioReader#190
Now portNumber explicitly mentioned by developer is used and not the
constants value of 8080.

Fixes FolioReader#276
Now even if any local server is running on 8080 or on the portNumber
set by developer prior to opening the book, FolioReader will try to you
other available portNumber with the help of java.net.ServerSocket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants