Next.js Discord

Discord Forum

SSE - Routes Handler open socket UDP

Unanswered
Black Caiman posted this in #help-forum
Open in Discord
Black CaimanOP
Hi guys, do you know how i can handle from routes handler (api nextjs 13) the request/response abort/close event from the client?

Since I open a socket to listen UDP packets I need to close the specific port otherwise the next request finds the port alteady binded. In general I would like to close the various listeners...

Furthermore, I would be interested to know if it is possible to have a sort of persistence, because even managing to solve the first problem, however, you could not have 2 simultaneous requests. Although I know they are serverless so it doesn't make much sense....

3 Replies

same goes to UDP i guess
Edge Runtime(Cloudflare Worker) does not support TCP/UDP base connections.