multithreading - java threaded socket : which thread receives the packet? -
i working on p2p project. project supposed able send , receive binary files , text messages concurrently. have 2 separate threads receiving file , messages. problem how specify thread should receive packet coming. improve have 1 thread both operations? if yes how can recognize received packet type?
you need 1 thread manage socket, , 1 each chat , file transfer. thread manager decided gets packet, based on whatever protocol devise distinguish packets.
java multithreading sockets p2p
No comments:
Post a Comment