Closed Lord-Kamina closed 4 years ago
Update: Starting the server using "localhost" makes it work only for localhost and not if I expressly use my local ip.
However, if I set the address to my computer's local IP, I can only access it from that IP (neither localhost nor 127.0.0.1 will work).
Just use "0.0.0.0" as the address.
What's the unit-measure for the buffer_size; bytes?
Yes, bytes.
I'm trying to understand exactly what read_next_http_message_timelimit is but I'm not sure I've got the right idea?
It's the maximum duration between the start of reading a new http-request and receiving the whole request. For example, a client connects to the server and then sends a couple of bytes and stops sending anything and doesn't close the connection. That connection will be automatically closed by RESTinio after read_next_http_message_timelimit
.
However, if I set the address to my computer's local IP, I can only access it from that IP (neither localhost nor 127.0.0.1 will work).
Just use "0.0.0.0" as the address.
Perfect, thanks.
What's the unit-measure for the buffer_size; bytes?
Yes, bytes.
I'm trying to understand exactly what read_next_http_message_timelimit is but I'm not sure I've got the right idea?
It's the maximum duration between the start of reading a new http-request and receiving the whole request. For example, a client connects to the server and then sends a couple of bytes and stops sending anything and doesn't close the connection. That connection will be automatically closed by RESTinio after
read_next_http_message_timelimit
.
I see; I thought it might have to do with re-using a connection between one request and another.
I thought it might have to do with re-using a connection between one request and another.
RESTinio is server only framework, there is no sense to re-use existing connection, it's a task of a client.
However, read_next_http_message_timelimit
will be taken into account in the following case:
Connection: Keep-Alive
header;read_next_http_message_timelimit
the connection will be closed by RESTinio.I think this issue is resolved, so I close it. Feel free to reopen if you have some more questions.
I'm trying to migrate Performous' webserver from CppRESTSDK; so far, I'm focusing on trying to get a basic RESTinio server working before fine-tuning everything and actually porting the router code.
Right now, a very basic server is working. However, if I set the address to my computer's local IP, I can only access it from that IP (neither localhost nor 127.0.0.1 will work). I am not sure whether this is an actual bug or whether I've configured something wrong. Care to help me please?
Also, two unrelated questions re: settings for which I couldn't find answers.
1) What's the unit-measure for the
buffer_size
; bytes? 2) I'm trying to understand exactly whatread_next_http_message_timelimit
is but I'm not sure I've got the right idea?P.S. here's the code I'm using to open the server:
The RequestHandler class lives inside a WebServer class defined as follows:
And StartServer does the following (not the entire code but the relevant bits):
m_server
in this case is theRequestHandler
instance that contains ourrestinio::http_server_t