Reputation: 1301
I've got a lot of questions regarding this e.g.. Hence enumerating them:
Note - I'm trying to integrate both programs to make a network discovery program wherein the client replies with it's details in the form of an object.
Upvotes: 2
Views: 435
Reputation: 11596
For your first question, you need datagrams (UDP) because tcp is a connection oriented protocol. i.e., each connection is for communication between one server and one client. You can have multiple clients connected to a server, but they'd all be individual unicast communication.
Regarding your second question, I don't think a delay you observe is due to your code. Post more details about your topology, etc. to help solve that issue.
Upvotes: 3