Advertisement

Can WinSock be used to talk to a Java Servlet ?

Started by January 06, 2002 11:28 AM
3 comments, last by Grasshopper 23 years ago
I trying to develop a game which allows computer opponents to play against cell phone users. Most of the game logic is handled by a Java Servlet which communicates between the mobile players and the computer players. I''m wondering how should i send info between the Servlet and the Win32 game program?
I''m not familiar with Java Servlets, but can you use the Socket routines in Java? If so, then just use sockets to communicate between the two.

If Java Servlets are more like ASP pages and you can only serve up HTML (or whatever) to the client, then do that and use WinInet APIs (though WinInet sucks for anything complex).


-Brannon
-Brannon
Advertisement
Thanks. I''ve thought about using both methods your suggested. I not sure if Windows and Java Socket are compatible. Does anyone know if this will work?

About using WinInet. Since the http can only respond to requests is there anyway for the Servlet to let the C++ client know that an event has occured (say an opponent has finished his turn)? Would the C++ client have to continuously poll the Java Servlet for new info or is there another way?
Using WinInet you would pretty much have to poll the server. That''s just the way the web works=).

As for Java sockets and Windows sockets being compatible, that is a definite "Yes". That''s kind of the point of sockets. If you can''t get a Java Servlet to talk to a Windows-based client, then you are doing something wrong. It should definitely work (how else would Internet Explorer be able to open JSP pages?)


-Brannon
-Brannon
Yes, you can communicate between winsock/BSD sockets and java socket calls. We do it all the time.

This topic is closed to new replies.

Advertisement