Jump to content

[SOLVED] Interfacing to a C or Java plugin


blackcell

Recommended Posts

If I build something with another language how do I implement it into a web page? Do you have to do the interfacing method with the language you built it with? For instance, JAVA applications on websites. Are they built with the functions to tie into a web page with the Java language?

Hmmmmmm..

 

I am pretty sure you can look up Java JNI to come up with a solution if you needed to, but generally if you want to hook 2 apps up you're going to need to provide some sort of way to interface.

 

If you wanted to have a chatroom written in Java that a PHP script could work with, most likely what you'd do is set up (prototype):

 

TcpIpConnection.java

ChatRoomServer.java

 

(And you'd have ChatRoom.java + friends for servicing the normal chatroom)

 

ChatRoomServer would initiate a TcpIp Listen on port <x> and broadcast any events that happened in the chat room.

 

Beyond doing some sort of integration like that, remember, any function provided by PHP is actually implemented in C/C++. You could write your own extension (like GD) that interfaces with your chat program, so that in PHP all you would have to do is like:

 

chat_start();

#in some sort of ajax script

print chat_poll();

 

Hope this makes sense.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.