Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Can Java Socket and ServerSocket work with C/C++ or any languages that support TCP/IP?

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought Java ServerSocket only works with Java Socket.
 
author
Posts: 23877
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tejas Jain wrote:I thought Java ServerSocket only works with Java Socket.



The ServerSocket and Socket classes are used to get to the TCP stack ... and there is nothing language specific about the stack. It is just a network protocol.

Henry
 
Tejas Jain
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used Java1.1 ServerSocket 13 yrs ago with a C socket, but it did not work. Then I used ServerSocket with Java Socket, it worked fine. I remember I saw a document that stated
ServerSocket only works with Java Socket. I'm trying to find it. Henry, do you have a reference book on how ServerSocket works with any TCP sockets?
 
Henry Wong
author
Posts: 23877
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tejas Jain wrote:I used Java1.1 ServerSocket 13 yrs ago with a C socket, but it did not work. Then I used ServerSocket with Java Socket, it worked fine. I remember I saw a document that stated
ServerSocket only works with Java Socket. I'm trying to find it. Henry, do you have a reference book on how ServerSocket works with any TCP sockets?



Here are a couple of things to think about....

1. Think about some of the Java based web/app servers. Some, particularly the embedded ones, are pure Java. This means that they are implemented on top of the standard java net packages. What happens when these servers are hit by a non-java browser, like internet explorer?

2. Think about type 4 JDBC drivers. They are pure java, and hence, are implemented on top of the standard java net packages. Practically every commercial database has a type 4 driver available -- and most databases are not written in Java.

3. Think about the file sharing space -- particularly Azureus, the one that this pure Java. It too, was implemented on top of the standard java net packages. And it has to inter-operate with the many other non-Java based bit torrent clients out there.

Basically, if Java TCP implementation didn't conform to standard TCP, you wouldn't need to work so hard looking for an article from 13 years ago. There would be tons and tons of articles out there.

Henry
 
I like tacos! And this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic