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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:37:55+00:00 2026-05-16T16:37:55+00:00

I need to communicate between a Java app (desktop) and an iOS app. I’ve

  • 0

I need to communicate between a Java app (desktop) and an iOS app. I’ve decided to use AsyncSocket on the iPhone side (and I’ve gotten data sending to work). For this question, I’m just running the EchoServer demo app on OSX 10.6.4. Source code is here.

Here’s my Java code, boiled-down:

    Socket echoSocket = new Socket("192.168.0.102", 8085);
    PrintWriter out = new PrintWriter(echoSocket.getOutputStream(), true);
    out.println("hello there!");
    out.flush();

This works and the “hello there!” shows up on a TCP Monitor.

On the EchoServer, the output is just

           Accepted client 192.168.0.102:4960

So I know they’re talking but I cannot get the data!

Edit: On the Java side (with more code), I do receive the Welcome to the “AsyncSocket Echo Server” message.

Edit: If I browse to the server it works perfectly, so the problem is in my Java code. What else do I need to do for a complete write to a socket correctly?

  • 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-16T16:37:56+00:00Added an answer on May 16, 2026 at 4:37 pm

    I think this is a good clue, taken from that demo’s AppController.m:

    [sock readDataToData:[AsyncSocket CRLFData] withTimeout:READ_TIMEOUT tag:0];
    

    Looks like it will read a line that ends with a CR and LF. So what you might need to do on the Java side is this:

    out.print("hello, there\r\n");
    

    Or probably the same:

    out.println("hello, there\r");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario where I need a desktop console app to communicate with
I need to communicate Encrypted data between my Erlang/OTP Web Server and JavaScript. I
I need to communicate between Javascript and PHP (I use jQuery for AJAX), but
On my page I have n-userControls (same control) I need to communicate between them(to
I write app for Android which will be communicate with HTTP server. I need
I need to communicate between server/client. I saw that CORBA is used for different
I need to communicate with MongoDB shell via Java To explain in short, I
I need to figure out how to communicate between ViewModels. I'm new to MVVM
In Java, I need to grab a port number for communication between multiple instances
I need to be able to communicate between two applications that reside on the

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.