?
Solved

Networking in C......How to

Posted on 2003-03-22
6
Medium Priority
?
232 Views
Last Modified: 2010-04-15
Hi friends,
      I have been working on C-language for a long time and this is for the first time, I have started working on creating an network based application in C. so friends please help me in getting started....

      I have gone through the previous comments of the experts, but this comment wont help me now.....

thanks
satendra
0
Comment
Question by:satendrajain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 8

Accepted Solution

by:
adg080898 earned 100 total points
ID: 8189283
0
 

Assisted Solution

by:Getch
Getch earned 100 total points
ID: 8189758
Linux ??? Try this www.ecst.csuchico.edu/~beej/guide/net/
Beej Network Programming...

cya getch
0
 
LVL 4

Expert Comment

by:havman56
ID: 8195153
i advice u to start writing socket programmes
0
 
LVL 3

Expert Comment

by:r_a_j_e_s_h
ID: 8243449
if u r using MS VC++. try out the following code.   u should add ws2_32.lib in project settings.



#include<windows.h>
#include<winsock.h>
#include<stdio.h>

void main()
{
     WSADATA WSAData;  
     struct sockaddr_in  serv;
     char senddata[1000],aa[20];
     LPTSTR lpszSystemInfo1,lpszSystemInfo2;  

     WSAStartup (MAKEWORD(1,1), &WSAData);
     sockfd=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
     
     serv.sin_family=AF_INET;
     serv.sin_port=htons(3333);
     serv.sin_addr.s_addr=inet_addr("127.0.0.1");


     ret=connect(sockfd,(struct sockaddr*)&serv,sizeof(serv));

     ret=send(sockfd,senddata,lstrlen(senddata) + 1,0);

}
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10189701
Nothing has happened on this question in more than 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points between adg and Getch.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question