-
Notifications
You must be signed in to change notification settings - Fork 119
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
Server hangs #308
Comments
I can't quite reproduce and understand this: You say the client is terminated while the server is waiting. Later you mention it's not accepting any requests from the client any more. Are you trying again from the same IP address? Same port? (Probably not, as the simple6 transport picks a random port for requests). The way I've tested it is:
import aiocoap
from aiocoap import resource
import asyncio
class TestRes(resource.ObservableResource):
async def render_get(self, request):
breakpoint()
return aiocoap.Message(code=aiocoap.numbers.Code.BAD_REQUEST)
root = resource.Site()
root.add_resource(['.well-known', 'core'], resource.WKCResource(root.get_resources_as_linkheader))
root.add_resource(['some','res'], TestRes())
asyncio.Task(aiocoap.Context.create_server_context(bind=('::1', 5683), site=root))
asyncio.get_event_loop().run_forever() (This is basically your example just with full imports and a concrete loopback address)
To test on Linux, I set the Can you test with these precise commands on Windows, with your full setup on Linux, to tell whether that's a reproducing or a Windows issue? |
@chrysn tried with IPv6 (per your example) and with IPv4 ( Server code
Client execution Steps
|
I am testing a basic server client example.
The server is done as per the existing example:
I place a breakpoint within
render_get
and invoke a CoAP client that is then terminated while the server is waiting at the breakpoint.The server code goes into (as it detects that the connection was terminated):
Unfortunately, the server won't be able to accept any incoming requests from the client anymore. The client goes into constant retransmissions when re-run.
I am not sure why the server is not able to recover... Would appreciate any help.
python3 -m aiocoap.cli.defaults
:The text was updated successfully, but these errors were encountered: