From abe64ec527656efe0bbbfd351980beec0932fd25 Mon Sep 17 00:00:00 2001 From: gauthamthrilok <151773807+gauthamthrilok@users.noreply.github.com> Date: Thu, 12 Mar 2026 10:26:36 +0530 Subject: [PATCH] Clean up server.c by removing redundant struct Removed redundant struct declaration for serveraddr. --- Socket-Programming/TCP/server.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Socket-Programming/TCP/server.c b/Socket-Programming/TCP/server.c index 663912a..49d2b49 100644 --- a/Socket-Programming/TCP/server.c +++ b/Socket-Programming/TCP/server.c @@ -17,9 +17,7 @@ int main() struct sockaddr_in serveraddr,clientaddr; //creating a structure of type sockaddr_in for server socklen_t len; //creating a variable to store the length of the server address char message[50]; // - struct serveraddr; //creating a structure of type sockaddr_in for server - - + serversocket=socket(AF_INET,SOCK_STREAM,0); //creating a socket bzero((char*)&serveraddr,sizeof(serveraddr));//initializing the server address to zero serveraddr.sin_family=AF_INET;//setting the family of the server address to AF_INET @@ -68,4 +66,4 @@ Reading message from the client. The client has sent.HI,IAM CLIENT... Sending message to the client. s6d2@user-HP-280-G3-MT:~/Networking-Lab-S6/Socket-Programming/TCP$ ^C -*/ \ No newline at end of file +*/