Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

FormatException: Invalid port (at character 16) #64

Open
paulobreim opened this issue Dec 22, 2019 · 0 comments
Open

FormatException: Invalid port (at character 16) #64

paulobreim opened this issue Dec 22, 2019 · 0 comments

Comments

@paulobreim
Copy link

paulobreim commented Dec 22, 2019

Here is my code:
HttpServer.bind(InternetAddress.anyIPv4, port).then((server) {
print('Servindo em ${server.address}:${server.port}');
server.listen((HttpRequest request) {
handleGetRequest(request); // check de URL
request.response
..close();
});
});
I don't know why, but some times, the program stop with:
FormatException: Invalid port (at character 16)
http://0.0.0.0:81login.cgi
Sure that I am using port 81, but the port does not import.
This error occur even if there are anybody connecting.

Debuging the app I can see that the program is waiting for a connection in the line
server.listen((HttpRequest request)

From time to time, simply gives the message without anyone connecting

Another fact is that I am not put
import 'package:http_server/http_server.dart';
because when I put, I receive message that Target of URI doesn't exist

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant