Win a copy of Rust Web Development this week in the Other Languages forum!

Mark pet

Greenhorn
+ Follow
since Feb 23, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark pet

Client is running two thread C1 and C2. And server is running three threads S1, S2, and S3 threads. C2 must receive results after server finishes S3. I have problem in the last step. The client and server look like this. Any ides?



Server code:


Output must be:
Many thanks. File size is always same in this case. I fixed the issues of read(byte[] data) using loop. After sending image to the server (port 1234), client should wait till it starts to receive the modified image from the server. How to manage it. Should client use sleep, e.g., Thread.sleep(1000) or use different socket for sending image and receiving modified image. I am stuck in this step. Please suggest.
Here is client side



Server side




Issues: Client sends a file, server could not receive exactly same size of image file. Another issue is that server could not send back the modified file to server.
Flow should be like this a) client sends image b) server receives that image 3) then server starts to modify that image 4) server then send back that modified file to the client 5) client receives that modified file 5) client sends another image fine and procedure continue....Please help.




I have a TCP client server, where client sends image to the server. Server receives it and manipulates the image. Then the server sends back that manipulated image to the client. Once the client receives that image, it will send next image to the server to be processed. This process continues till 100 images to be processed. How to implement it in Java thread any suggestions?