Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

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: 23840
141
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: 23840
141
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'm gonna teach you a lesson! Start by looking at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!