1

I am trying to create a java socket server listener on Mac 10.6. iOS client will be accessing it through socket connection. I don't know, how to create and run such socket server on Mac. I got sample source from Java tutorials, i want to use the same code as it is to create new java socket server program on Mac.

Java socket server tutorial

I have Eclipse installed. How do I create and run a java socket program using the java tutorial code mentioned in the above link on a mac machine? I am new to this and not getting the basic steps involved on this. Please help.

Another sample link

1 Answer 1

1

You can create a simple java program with the code from this tutorials and run it. Its the same for mac that for windows or linux.

Perhaps you need first to understand how a simple java program works, if you are using eclipse take a look at this: http://oak.cs.ucla.edu/cs144/projects/eclipse/windows.html or find other java basic tutorials on the net, there are a lot.

Sign up to request clarification or add additional context in comments.

5 Comments

That's a great help. I can now understand creating new java project and run it. But, I need to run on server so that it can listen for socket callers. How can i do that? Should i run the same java project on Tomcat server, which i already have in eclipse? Will it work? Please provide your suggestion.
Tomcat is a web server, is used to build applications that can response to HTTP request (web applications). But tomcat its nothing more than a java program that uses socket internally and provides a relative simple way to build web services or applications without worring about low level details like sockets. You can build your own application that listen in a socket an execute like any other java program or perhaps you want to do a webservice for communicating your client with a server. In this case you need to understand how java servlets work (tomcat is a servlet server).
What should i do now? I want to use & run this java socket listner on server and try to do socket connection from my iOS client program. I have Mac and eclipse. "You can build your own application that listen in a socket an execute like any other java program " - which means, my question was, how this java java listner program will be running as if like on a server on my mac?
Read this about how to write/compile/execute a java program: oracle.com/technetwork/java/compile-136656.html
I could able run the java program in eclipse itself and made the socket listening properly. thank you so much!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.