June 19th, 2010, 12:24 PM
I'm building a client server application and I wanted to know what is the best way to implement it under the following constraints:
1) The server need to be implemented in JAVA.
2) The client need to be implemented in c#.
3) The Server need to be able to open the connection to the client and vise versa
4) There should be no port forwarding issues on the client machine, meaning the client will be easy deployed and without any network special configuration issues( such as port forwarding).
5) The communication between the server and client may be implemented under security terms in the future ( some encrypted handshake mechanism).
6) The communication between the server and client will use the Object Oriented mechanism using serialization and deserialization mechanism.
I thought of the following architectures:
1) Both the client and server will be web services. As what I know in this situation constraints 4 (port forwarding at the client) will be ignored, cause the client will need to be listening on a port for server requests. Also constraints 5 may be hard to implemented.
2) server will be web service (for client requests) and for requests started from the server - the client and the server will communicate through normal tcp communication layer under dedicated PROTOCOL. Only as what I found out constraint 6 is hard to acheive, meaning that in order to use the same objects as transferred objects (using some serialization and deserialization mechanism) I should use some heavy libraries such as : IIOP.NET or Ja.NET.
The best way I would like to implement these application is using the principle of web services (including the tool to generate the supose to be transferred classes for both JAVA and C#), with the ability to achieve all the constraints I mentioned.
You can think of ICQ,MSN application as an example.
June 19th, 2010, 04:30 PM
Constraints 1, 2, 5 and 6 shouldn't be much of an issue. If you can send data, then you can send secure data. Likewise, if you can send data then you can send serialized data.
Without port forwarding this can't be done. The client has to initiate the connection if it's behind a NAT layer and doesn't have the correct port forwarded to them.
What you can to do is have the client open the connection to the server when it is started and leave the connection open. The server can then send information through the open connection when ever it needs to.
This can be done by "punching" a hole through the NAT layer, however like I said above the client must initiate the connection, it can't be initiated by the server.
June 19th, 2010, 06:45 PM
You might consider using SMTP as the transport mechanism if you can live with the potentially high latencies.
Originally Posted by tomerp
You should also look into AMQP.
I no longer wish to be associated with this site.
June 21st, 2010, 04:57 PM
Thanks, I'll check the AMQP.