Networking in C......How to

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
satendrajainAsked:
Who is Participating?
 
GetchConnect With a Mentor Commented:
Linux ??? Try this www.ecst.csuchico.edu/~beej/guide/net/
Beej Network Programming...

cya getch
0
 
havman56Commented:
i advice u to start writing socket programmes
0
 
r_a_j_e_s_hCommented:
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
 
jmcgOwnerCommented:
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
All Courses

From novice to tech pro — start learning today.