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

Community
  • 1
  • 1
Stella
  • 1,728
  • 5
  • 41
  • 95

1 Answers1

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.

AlfredoCasado
  • 818
  • 5
  • 7
  • 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. – Stella Feb 01 '14 at 18:50
  • 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). – AlfredoCasado Feb 02 '14 at 00:07
  • 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? – Stella Feb 02 '14 at 02:53
  • Read this about how to write/compile/execute a java program: http://www.oracle.com/technetwork/java/compile-136656.html – AlfredoCasado Feb 02 '14 at 09:39
  • I could able run the java program in eclipse itself and made the socket listening properly. thank you so much! – Stella Feb 02 '14 at 16:34