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 8022207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:12:05+00:00 2026-06-04T22:12:05+00:00

I’m trying to to use an application to communicate with Windows via sockets. At

  • 0

I’m trying to to use an application to communicate with Windows via sockets. At the minimum, I’m trying to at least figure out how I can create a connection from the iPhone (maybe using the iPhone to ping the Windows machine?) I’m not really clear on where I need to start. I’m pretty new to iOS development in general, and brand new to socket/network programming. I’ve tried several tutorials that haven’t gotten me far. My goal is:

  • Connect to a server via sockets (the server will be a Windows machine with a service waiting for incoming connections from the iPhone)
  • I will eventually be sending JSON packets to the server, as well as receiving JSON packets from the server
  • Come up with a response in the iPhone indicating success or failure

If possible, I would like to write/build the client piece first, but I have been lost thus far. Hopefully the nice folks in the SO community can lend a hand and point me in the right direction.

Thanks in advance!

  • 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-06-04T22:12:07+00:00Added an answer on June 4, 2026 at 10:12 pm

    Your question is very wide especially that it does not target a specific programing problem. I will give you some guidelines or point of start.

    For iPhone you need to learn how to work with NSStream and you might start from here: Stream Programming Guide for Cocoa. You will need an output stream and an input stream so you can manage outgoing and incoming communications easily and in parallel. In other words you will benefit from the NSInputStream and the NSOutputStream classes which are derived from the main NSStream class. When you will send data using streams you will send raw data using uint8_t buffers so it is not obligatory to use JSON packets; I personally don’t, but it is up to you.

    On Windows I assume you will be using C# so you will need to learn TcpListener which listens on a certain IP address and a port number that you specify. This can start you up a bit: TcpListener Class. Also you will need TcpClient through which you will read and write to the stream.

    For efficient server you need to work Asynchronously and TcpClient has synchronous and asynchronous methods for that. Also for better functionality you might need to use threading in your server, or use the built in BackgroundWorker class which makes things much more easy.

    I don’t suggest programming the client alone then the server, I believe that they should go in parallel because it is a 2 sided communication and if you try that you will see that you must work little here and little there. It is not a surprise if I tell you that when I work on my client/server app I have on my desk a Mac and a PC and I switch between them every while.

    Finally, I would like to comment on something which you did not ask about. Since your client is a mobile device then you have to expect that it is not always on (or no Internet connection always on it), therefore prepare yourself to have some database work in the server to be able to store messages that need to be sent later…

    I hope this can help you start up. If you have a more specific question I might be able to illustrate better. By the way, this job is not that easy but it is great fun if you really like programming, especially when you start to get your first results 😉

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported

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.