Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6332787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:21:01+00:00 2026-05-24T18:21:01+00:00

I built a fairly simple program that watches a folder, manipulates files as they

  • 0

I built a fairly simple program that watches a folder, manipulates files as they are added, and gives a simple progress view of whats going on. The folder is watched via a subclass of NSOperation that passes information in an NSDictionary to my progress view, via the NSNotificationCenter.

Now I need to break things up and run the watched folder/processing part on my server, and build a client to monitor the progress from multiple workstations. My problem is I don’t know how to accomplish this and my searches aren’t really helping me.

It seems I’m getting a lot of out dated solutions (WebObjects, Portable Distributed Objects) or incomplete information. It seems like I’d want to use NSStream to pass data back and forth, but everything I find on NSStream looks like it’s set up for client side because it’s looking for an IP address. What would be the best way to go about setting up both a server, and a client to connect to it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:21:02+00:00Added an answer on May 24, 2026 at 6:21 pm

    I would suggest using TCP for something like this. Since (I assume) you are writing this software for BSD (Mac OS X and iPhone are both BSD) you can use BSD C sockets, or an Objective-C wrapper for this. One good library for a client is CocoaAsyncSocket. I personally have written a lightweight Objective-C socket class for TCP networking called SocketKit. Usage of this library is something as follows:

    // open a connection
    SKTCPSocket * socket = [[SKTCPSocket alloc] initWithRemoteHost:@"SERVER_IP" port:SERVER_PORT];
    // write data
    [socket writeData:someData];
    // read data
    NSData * someData = [socket readData:4];
    // close the socket
    [socket close];
    [socket release];
    

    From a server standpoint, you can listen on a port using the SKTCPSocketServer class:

    SKTCPSocket * aSocket = nil;
    SKTCPSocketServer * server = [[SKTCPSocketServer alloc] initListeningOnPort:1337];
    @try {
        [server listen];
        while ((aSocket = (SKTCPSocket *)[server acceptConnection]) != nil) {
            // do something with aSocket
            [aSocket close];
        }
    } @catch (NSException * e) {
        NSLog(@"Exception : %@", e);
    }
    [server stopServer];
    [server release];
    

    Of course using TCP sockets means writing your own network protocol. A simple example would be sending a four byte length field, followed by the data of an NSDictionary or something of that nature. This could allow you to accomplish something similar to a very basic Distributed Objects system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a fairly simple register php script that uses PHP's built in mail()
I'm working on a fairly large web site built in PHP that will potentially
I am trying to build an fairly simple iPad app that requires me to
I have a fairly simple Psake build script (default.ps1) that calls Invoke-Psake from within
I have a fairly simple ajax call built on jQuery. It works perfectly in
I have a fairly simple app built with pyqt4. I wanted to debug one
I have a fairly large program written in C. It spans several files, and
I have a fairly simple web app built with Delphi (2009) Web Broker. I
I have a fairly simple question that has me stymied. I am trying to
I am writing a fairly simple WPF desktop application and under build\configuration manager, release

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.