reactphp / socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.
https://reactphp.org/socket/
MIT License
1.2k stars 156 forks source link

Client and Server at same time #240

Closed majidnow closed 4 years ago

majidnow commented 4 years ago

Hi Note: my problem is't library issue, it's work just fine. I'm trying to create one loop as a server( web socket for a web application) and another as a client(get data from a service using by a tcp server). the received data by client will send to web application after some processing things through server (web socket). When I ran loop (even inside a thread) after that I can't run second one(first one block running procedure). How can I solve this?

WyriHaximus commented 4 years ago

There can only be one event loop. So if you have two one will always block another, instead let both client and server use the same loop

majidnow commented 4 years ago

Thanks for help. problem solved.

clue commented 4 years ago

I'll assume this is resolved and will close this for now, please feel free to report back otherwise :+1: