Code Monkey home page Code Monkey logo

Comments (6)

lganzzzo avatar lganzzzo commented on May 25, 2024

Hello @linhaojun857 ,

wepoll is a possible solution.
The disadvantage of it is that we have to add a 3rd party dependency to the main oatpp's main module -
what we were trying to avoid all this time.

I was planing to implement IOEventWorker using Windows I/O Completion Ports. Just have to find time to do this.
If you will you can start investigating possible ways to implement it IOEventWorker using Windows I/O Completion Ports
I'll provide all necessary assistance.

Regards,
Leonid

from oatpp.

linhaojun857 avatar linhaojun857 commented on May 25, 2024

Hello @linhaojun857 ,

wepoll is a possible solution. The disadvantage of it is that we have to add a 3rd party dependency to the main oatpp's main module - what we were trying to avoid all this time.

I was planing to implement IOEventWorker using Windows I/O Completion Ports. Just have to find time to do this. If you will you can start investigating possible ways to implement it IOEventWorker using Windows I/O Completion Ports I'll provide all necessary assistance.

Regards, Leonid

@lganzzzo I think I can do it

from oatpp.

linhaojun857 avatar linhaojun857 commented on May 25, 2024

@lganzzzo After today's attempts, I find it quite difficult to implement EventWorker using iocp. Because iocp reads and writes the socket asynchronously, it cannot listen to events like epoll and call the suspended coroutine function in EventWorker synchronously. My current thinking is, In the setCoroutineEvent function, determine the IOEventType of the action. If it is IO_EVENT_READ, call the WSARecv function to post an IO request to the iocp. If it is IO_EVENT_WRITE, Call the WSASend function to post an IO request to the iocp, but encounter a problem, the delivered io operation can not find a good way to update the position in the upper buffer when reading and writing to the socket, I'd like to ask if you have any good ideas.

from oatpp.

linhaojun857 avatar linhaojun857 commented on May 25, 2024

@lganzzzo I think i can refer to this https://github.com/golang/go/blob/master/src/runtime/netpoll_windows.go

from oatpp.

lganzzzo avatar lganzzzo commented on May 25, 2024

Hello @linhaojun857 ,

@lganzzzo After today's attempts, I find it quite difficult to implement EventWorker using iocp. Because iocp reads and writes the socket asynchronously, it cannot listen to events like epoll and call the suspended coroutine function in EventWorker synchronously. My current thinking is, In the setCoroutineEvent function, determine the IOEventType of the action. If it is IO_EVENT_READ, call the WSARecv function to post an IO request to the iocp. If it is IO_EVENT_WRITE, Call the WSASend function to post an IO request to the iocp, but encounter a problem, the delivered io operation can not find a good way to update the position in the upper buffer when reading and writing to the socket, I'd like to ask if you have any good ideas.

Yeah, I was expecting such kind of problems with IOCPs...
Do you have your code pushed somewhere?
Or I can create a branch to play with it

from oatpp.

linhaojun857 avatar linhaojun857 commented on May 25, 2024

Hello @linhaojun857 ,

@lganzzzo After today's attempts, I find it quite difficult to implement EventWorker using iocp. Because iocp reads and writes the socket asynchronously, it cannot listen to events like epoll and call the suspended coroutine function in EventWorker synchronously. My current thinking is, In the setCoroutineEvent function, determine the IOEventType of the action. If it is IO_EVENT_READ, call the WSARecv function to post an IO request to the iocp. If it is IO_EVENT_WRITE, Call the WSASend function to post an IO request to the iocp, but encounter a problem, the delivered io operation can not find a good way to update the position in the upper buffer when reading and writing to the socket, I'd like to ask if you have any good ideas.

Yeah, I was expecting such kind of problems with IOCPs... Do you have your code pushed somewhere? Or I can create a branch to play with it

@lganzzzo Because I haven't found a suitable way, I haven't finished the code yet. I will keep thinking about the solution to this problem

from oatpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.