problem with async chat client in windows

Discussion in 'Python' started by Jonas, Jan 5, 2004.

  1. Jonas

    Jonas Guest

    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/lib/module-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
    Jonas, Jan 5, 2004
    #1
    1. Advertising

  2. Jonas

    Jp Calderone Guest

    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
    Jp Calderone, Jan 5, 2004
    #2
    1. Advertising

  3. Jonas

    Jonas Guest

    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??
    Jonas, Jan 5, 2004
    #3
  4. Jonas

    Jp Calderone Guest

    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
    Jp Calderone, Jan 5, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    2,181
  2. William Chang

    Async Client with 1K connections?

    William Chang, Feb 10, 2004, in forum: Python
    Replies:
    12
    Views:
    592
    William Chang
    Feb 13, 2004
  3. Steven
    Replies:
    0
    Views:
    348
    Steven
    Nov 30, 2005
  4. Dhiraj Girdhar

    Chat server telnet client problem

    Dhiraj Girdhar, Jul 5, 2007, in forum: Ruby
    Replies:
    0
    Views:
    152
    Dhiraj Girdhar
    Jul 5, 2007
  5. Laszlo Nagy

    Async client for PostgreSQL?

    Laszlo Nagy, Sep 1, 2012, in forum: Python
    Replies:
    2
    Views:
    300
Loading...

Share This Page