I put a TCP server and client code in PIC controller. Now just wanted to know, can the same device run both client and server at sametime? And if possible can we use the same socket on a TCP stack for server and for client?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your question about using the same socket doesn’t really make any sense since presumably the client and the server are separate processes, so they cannot share the exact same socket. For a server, you usually create a socket, then
bindit to a specific port, andacceptconnections. For the client, you create a socket, andconnectto a specified address (an IP address and port pair for a TCP/IP connection).The same device can run a TCP server and client at the same time. You can start the server listening on a specific port and then connect the client to the same port, and the two programs will communicate with each other.