Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Socket connection with other languages?

  Asked By: Everett    Date: Sep 20    Category: Java    Views: 986
  

Is this possible that I make a TCP Socket client in Java to receive
data from a server that is implemented in C running over TCP/IP?

If yes what would be data type of Input and Output streams for the
Java client?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Kawthar Malik     Answered On: Sep 20

theres something called the TCP/IP Stack.

Physical - Cable
Data link - Link layer
Network - MAC address (Hub/Switch)
Transport - Routing [IP Layer]
Session - Connection between hosts [TCP/UDP]
Presentation - HTTP protocols etc
Application - Applications that use the data

You dont need to think about the preentation layer so much if you are
writing socket  programs.

But if you note the layers, there are protocols that follow this. This
stack is what everyone has to use if they want to use UDP/TCP/IP.

If the C program is using TCP you will need to use java.net.Socket.

You will have to get a protocol definition from whoever wrote the
program to find out how it works. Alternativly you can reverse engineer
the program and write you own protocol description.

 
Didn't find what you were looking for? Find more on Socket connection with other languages? Or get search suggestion and latest updates.




Tagged: