problem with async chat client in windows

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonas

    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
  • Jp Calderone

    #2
    Re: problem with async chat client in windows

    On Mon, Jan 05, 2004 at 03:02:29AM +0100, Jonas wrote:[color=blue]
    > 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[/color]

    Why not? select works perfectly well on Windows.

    See http://www.twistedmatrix.com/

    Jp

    Comment

    • Jonas

      #3
      Re: problem with async chat client in windows

      Jp Calderone wrote:[color=blue]
      > On Mon, Jan 05, 2004 at 03:02:29AM +0100, Jonas wrote:
      >[color=green]
      >>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[/color]
      >
      >
      > Why not? select works perfectly well on Windows.
      >
      > See http://www.twistedmatrix.com/
      >
      > Jp
      >[/color]

      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??

      Comment

      • Jp Calderone

        #4
        Re: problem with async chat client in windows

        On Mon, Jan 05, 2004 at 04:49:56PM +0100, Jonas wrote:[color=blue]
        > Jp Calderone wrote:[color=green]
        > >On Mon, Jan 05, 2004 at 03:02:29AM +0100, Jonas wrote:
        > >[color=darkred]
        > >>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[/color]
        > >
        > >
        > > Why not? select works perfectly well on Windows.
        > >
        > > See http://www.twistedmatrix.com/
        > >
        > > Jp
        > >[/color]
        >
        > 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??[/color]

        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

        Comment

        Working...