Re: Python non blocking multi-client service

2016-08-25 Thread sohcahtoa82
On Tue, Aug 23, 2016 at 11:39 PM, wrote: > On Tuesday, August 23, 2016 at 6:42:53 AM UTC-7, Chris Angelico wrote: > > On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > > > except: > > >print ('Error') > > > > > > Don't do this. > > > >

Re: Python non blocking multi-client service

2016-08-23 Thread INADA Naoki
> > I did that only for the debug reasons :-) That's bad for debugging too. Real Exception and Stacktrace are far better than print('Error') on all time. Never do it even for debugging. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python non blocking multi-client service

2016-08-23 Thread Zentrader
I don't know anything about asyncio, but multiprocessing would be my tool of choice. The first example should be enough for what you want to do at https://pymotw.com/2/multiprocessing/basics.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Python non blocking multi-client service

2016-08-23 Thread dima . olkhov
On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > I am trying to implement multi-client service. The service must be able to: > > connect to the server; > send/receive messages; > wait until a new message will be received > *** Per each client and non blocking > > My current code

Re: Python non blocking multi-client service

2016-08-23 Thread dima . olkhov
On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > I am trying to implement multi-client service. The service must be able to: > > connect to the server; > send/receive messages; > wait until a new message will be received > *** Per each client and non blocking > > My current code

Re: Python non blocking multi-client service

2016-08-23 Thread Chris Angelico
On Tue, Aug 23, 2016 at 11:39 PM, wrote: > except: > print ('Error') > Don't do this. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python non blocking multi-client service

2016-08-23 Thread dima . olkhov
On Tuesday, August 23, 2016 at 4:09:07 PM UTC+3, dimao wrote: > I am trying to implement multi-client service. The service must be able to: > > connect to the server; > send/receive messages; > wait until a new message will be received > *** Per each client and non blocking > > My current code

Re: Python non blocking multi-client service

2016-08-23 Thread Chris Angelico
On Tue, Aug 23, 2016 at 11:08 PM, dimao wrote: > My current code takes almost 99% CPU usage. Here is the main part of my code : > > > PORT= 33123 > HOST= '127.0.0.1' > > > import asyncio > import os > > @asyncio.coroutine > def tcp_echo_client(offset): > >

Python non blocking multi-client service

2016-08-23 Thread dimao
I am trying to implement multi-client service. The service must be able to: connect to the server; send/receive messages; wait until a new message will be received *** Per each client and non blocking My current code takes almost 99% CPU usage. Here is the main part of my code : PORT=