This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Java Methods in a windows java service

 
Davie Lang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to be able to allow a C programme to interface with my Java Service.

I know I can use the JNI to allow the C programme to talk to Java, but how can I get the C programme to talk to Java if it is running as a windows java service?

Thanks in advance for any advice.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like a job for socket communication. Your Java program can establish a java.net.ServerSocket and listen for requests from the C program. Once a connection is established, start a Thread to accept the data from the C program, process it and return the result.
I believe we have a whole forum here for socket related programming.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic