🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Can WinSock be used to talk to a Java Servlet ?

Started by
3 comments, last by Grasshopper 22 years, 6 months 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?
Advertisement
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
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