473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

problem with async chat client in windows

Hi,
I'm writing a small chat client to learn some python and networking. No problem
with the network stuff tho, the problem is when the user should be able to
interact and type messages to send. Since I work with windows I can't use the
select function (http://www.python.org/doc/current/li...e-select.html).
Maybe it could work if I use two threads? One thread reading keyboard and the
other handling network stuff, but I would prefer to leave threads out from this.
Any suggestions?

thx for your time
Jul 18 '05 #1
3 1957
On Mon, Jan 05, 2004 at 03:02:29AM +0100, Jonas wrote:
Hi,
I'm writing a small chat client to learn some python and networking. No
problem with the network stuff tho, the problem is when the user should be
able to interact and type messages to send. Since I work with windows I
can't use the select function


Why not? select works perfectly well on Windows.

See http://www.twistedmatrix.com/

Jp

Jul 18 '05 #2
Jp Calderone wrote:
On Mon, Jan 05, 2004 at 03:02:29AM +0100, Jonas wrote:
Hi,
I'm writing a small chat client to learn some python and networking. No
problem with the network stuff tho, the problem is when the user should be
able to interact and type messages to send. Since I work with windows I
can't use the select function

Why not? select works perfectly well on Windows.

See http://www.twistedmatrix.com/

Jp


Well the standard library select doesn't work for file descriptors like stdin on
windows and I didn't know about Twisted. Anyway there must be some way to solve
this without the need for extra depencencies??
Jul 18 '05 #3
On Mon, Jan 05, 2004 at 04:49:56PM +0100, Jonas wrote:
Jp Calderone wrote:
On Mon, Jan 05, 2004 at 03:02:29AM +0100, Jonas wrote:
Hi,
I'm writing a small chat client to learn some python and networking. No
problem with the network stuff tho, the problem is when the user should
be able to interact and type messages to send. Since I work with windows
I can't use the select function

Why not? select works perfectly well on Windows.

See http://www.twistedmatrix.com/

Jp


Well the standard library select doesn't work for file descriptors like
stdin on windows and I didn't know about Twisted. Anyway there must be some
way to solve this without the need for extra depencencies??


Ahh! I did not jump from "type messages to send" to "select on stdin",
just assumed you were popping up a window into which the user could type.

Twisted won't help with reading from stdin, as it relies on select()
working on that file descriptor.

Not sure if one of the win32-specific modules has something useful here.
I'd probably just use a GUI.

Sorry,

Jp

Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ahmed | last post by:
Hello everyone, I am designing a chat program for a company. The program will be used locally(through lan). I am progamming the chat program using VB.NET windows application. Lets consider the...
7
by: Shak | last post by:
Hi all, I'm trying to write a thread-safe async method to send a message of the form (type)(contents). My model is as follows: private void SendMessage(int type, string message) { //lets...
3
by: Ryan Liu | last post by:
Will TcpClient.GetStream().Read()/ReadByte() block until at least one byte of data can be read? In a Client/Server application, what does it mean at the end of stream/no more data available? ...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.