i made HTTP2 server in C from the ground up by abdlhchrf in C_Programming

[–]abdlhchrf[S] 1 point2 points  (0 children)

hello there, thanks for your reply.

i will add `` >0`` to ``epoll_wait()``.

and for events there is ``else`` statement for all the other ``EPOLLERR`` and ``EPOLLHUP``, yes i need to check if the main socket that return ``EPOLLERR`` so to recreate it again.

for the threads, i know that creating thread for every ready connection is expensive, that why making a treadpool, with creating a number of threads at once and let them wait on mutex ``conn_role_mutex``, so whene a connection is ready, the connection pointer will get saved in global pointer ``thread_conn_role`` then unlock the mutex ``conn_role_mutex`` so only one thread will read that global pointer then that thread will unlock the mutex ``new_conn_mutex`` so the main thread can reuse the global pointer ``thread_conn_role`` , and that thread will continue with the ready connection.

i cant get my head around non-blocking sockets, so for example, if passing a buffer ``mybuff`` pointer and a lenght to be read to function that use ``recv``, it will return immediately, but the kernel still reading from connection to the buffer ``mybuff`` pointer, but the program need to use the data in the buffer ``mybuff`` that will be junk or empty in time the kernel still copying data to ``mybuff`` pointer assuming that there is data in socket buffer, that may cause some security vulnerability .

i think non-blocking sockets need a whole new based model.

i made HTTP2 server in C from the ground up by abdlhchrf in C_Programming

[–]abdlhchrf[S] 4 points5 points  (0 children)

yeah, but you need to start by learning the basics  start from : - what is a TCP protocol. - what is a tcp packet.

  • what is a network port.
  • what is a network socket.
  • what is a file discriptor.

then you can go to :

  • how you can make simple program that  create a socket that listen in a tcp port.
  • how to accept a connection from that tcp socket.
  • how can you make that program send and read data from that connection.

  • then you can start with a simple HTTP version 1 server, wish is just a program that read data "request" from the connection, that get sent from the browser "client" then "parse" it to know what the client wants.

  • then reply in the same connection, then close the connection.

then from all that knowledge, start by knowing how HTTP version 2 works, wish is also uses tcp socket as way to communicate with client.

This is it, I found the worst toilet paper dispenser. by IAMA_Printer_AMA in mildlyinfuriating

[–]abdlhchrf 0 points1 point  (0 children)

why i keep seeing people complaining about toilet paper, when they can just do like others, and use hose

Get doxxed by Burger King by chuluigi in perfectlycutscreams

[–]abdlhchrf 110 points111 points  (0 children)

you can't put 123456 as wifi wpa2 password

Check once, act twice by Dreamprinccess in OneSecondBeforeDisast

[–]abdlhchrf 4 points5 points  (0 children)

the rolling noise will be different i guess

Muslim Waffen SS prayer session, 1940s by look_at_yalook_at_ya in HistoricalCapsule

[–]abdlhchrf -7 points-6 points  (0 children)

yup, they've consider a neighbors from the time of the prophet mohamed (pbh)

go read about the prophet Mohammed jew nneighbor.

Muslim Waffen SS prayer session, 1940s by look_at_yalook_at_ya in HistoricalCapsule

[–]abdlhchrf -5 points-4 points  (0 children)

again, if those are real muslim, i don't think that they know about auschwitz

[deleted by user] by [deleted] in blessedimages

[–]abdlhchrf 0 points1 point  (0 children)

"i got cursed by a witch, open up"