• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Simple Network Client Design (newbie alert)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple Network Client Design (newbie alert)


  • Subject: Simple Network Client Design (newbie alert)
  • From: Ross Hayden <email@hidden>
  • Date: Wed, 30 Jan 2002 10:42:48 -0500

When I was learning network programming on Unix, I wrote a simple TCP client and server pair, where the server would echo back the lines of text sent to it by the client. I typed in a line of text at my client, which then sent it to the server which would send it back to the client and display on my terminal.

I'm trying now to rewrite the client in Cocoa.

I've redesigned it so that reading from the socket blocks in a thread and doesn't hold up my user interface. I hope that's the best way to do that?

I created an NSTextView in which to display text echoed back from the server. My problem here is understanding how I can inject data into an NSTextView from my socket reader thread. I tried using setString: but what happens is that only the top three lines of my NSTextView ever fill with text before scrolling starts, even though the NSTextView box itself is large enough to display about 15 lines.

I also tried insertText: which never displays a thing.

I'm clearly lost here! Any help is much appreciated.

Ross


  • Follow-Ups:
    • Re: Simple Network Client Design (newbie alert)
      • From: Kaelin Colclasure <email@hidden>
    • Re: Simple Network Client Design (newbie alert)
      • From: Ondra Cada <email@hidden>
    • Re: Simple Network Client Design (newbie alert)
      • From: Malte Tancred <email@hidden>
  • Prev by Date: Re: System contextual menus
  • Next by Date: Clicking on a disabled ComboBox / FwUp: Window-closing sequence...
  • Previous by thread: Re: System contextual menus
  • Next by thread: Re: Simple Network Client Design (newbie alert)
  • Index(es):
    • Date
    • Thread