Is it possible to send data with Java over TCP and receive that data with a C# server?
-
For instance 2 computers on the same network, one has a Java client that outputs a string converted to bytes through an OutputStream (using port for example 4444), then the C# server would receive those bytes (from the same port 4444) and turn them into a string again and display whatever was sent from the client side. I already know how to do this with a Java client and server, I was just wondering if C# and Java can interact that easily. And I'm talking about standard native Java libraries and the same goes for C#. Thanks in advance.
-
Answer:
Yes, look up "sockets programming" on both.
Ahmed at Yahoo! Answers Visit the source
Other answers
The client and server have no concern over what language each other use at all. The routing and data transfer is done entirely by IIS on Windows and Apache on Linux. The java running on the client sends an http data stream, and depending on if the server is Windows or Linux, it gets routed to the appropriate C#, ASP, PHP, Perl or some other CGI routine. If the server is Windows, then the Java client will be communicating with C# routines. Thinking about sockets is way too complex. That is for programming languages. C# and Java are not programming languages, but scripting languages interpreted at run time. The actual programs are the sandbox interpreters that execute the C# or Java, and they already are doing all the low level socket programming. You don't have to do any in C# or Java.
Look at the System.Net.Sockets name space, specifically the classes TcpListener and TcpClient, the Socket class might be interesting as well.
yes its possible. write in C# a socket listener program. write in java a socket write program and thats it. C# doesnt need to bother about java and java doesnt need to bother about c#
Related Q & A:
- How to send data from device to remote server?Best solution by Stack Overflow
- How to send data from Android Wear to handheld?Best solution by androprogrammer.com
- Is it possible to send message to Chrome Extension from Java Desktop Application?Best solution by Stack Overflow
- How to change column data's as a separate column wise format in a SQL Server?Best solution by stackoverflow.com
- Is it possible to transfer data wirelessly between your PS3 and your computer?Best solution by answers.yahoo.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.