How to send a binary stream from Java-client to C#-server via Tcp?

  • Context: Java 
  • Thread starter Thread starter user366312
  • Start date Start date
  • Tags Tags
    Binary Stream
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
39 replies · 9K views
PeterDonis said:
Why would he want to do that? He's not trying to transfer files.
Transferring a bit stream has the same inherent problems as transferring binary files. It is not dead easy - FTP has gone through several revisions.
 
  • Like
Likes   Reactions: jedishrfu
Physics news on Phys.org
user366312 said:
Which console? C# or Java?

Both the C# will show that it works and the Java one will show something else that may be key to your problem.
 
jedishrfu said:
Both the C# will show that it works and the Java one will show something else that may be key to your problem.

I have solved the problem. Never mind.

I thank all of you for your time and effort.
 
jedishrfu said:
That's great!

So what was the problem?

There was difference in r/w data format.

I am now using raw data format on both ends. I am using byte arrays.
 
Svein said:
Transferring a bit stream has the same inherent problems as transferring binary files

It has some of the same inherent problems, yes. But those problems are lower level than the application/protocol level. At the application/protocol level, FTP is specialized for transferring files (which don't have to be binary, FTP has a text mode as well--not that I would recommend using it, but it has one :wink:). And actually it's not a very good protocol for transferring files, since it requires two TCP connections instead of one and coordination between the two connections (control and data) is clunky.
 
user366312 said:
There was difference in r/w data format.

I am now using raw data format on both ends. I am using bye arrays.

If this work gets more involved then you might want to consider zeromq.

Its very popular for communications between disparate programs in a microservices environment, has several multi-program architectures depending on the problem, and you get extra capability that might prove useful in the future.
 
jedishrfu said:
If this work gets more involved then you might want to consider zeromq.

Its very popular for communications between disparate programs in a microservices environment, has several multi-program architectures depending on the problem, and you get extra capability that might prove useful in the future.

ZeroMQ is good for professional solutions. I doing a semester project.
 
user366312 said:
ZeroMQ is good for professional solutions. I doing a semester project.

But you could put it on your resume sometimes these little things make a big difference.
 
jedishrfu said:
But you could put it on your resume sometimes these little things make a big difference.
Okay. Thanks for the advice. I will look into that.