satendrajain
asked on
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i advice u to start writing socket programmes
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,lpszSystem Info2;
WSAStartup (MAKEWORD(1,1), &WSAData);
sockfd=socket(AF_INET,SOCK _STREAM,IP PROTO_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(ser v));
ret=send(sockfd,senddata,l strlen(sen ddata) + 1,0);
}
#include<windows.h>
#include<winsock.h>
#include<stdio.h>
void main()
{
WSADATA WSAData;
struct sockaddr_in serv;
char senddata[1000],aa[20];
LPTSTR lpszSystemInfo1,lpszSystem
WSAStartup (MAKEWORD(1,1), &WSAData);
sockfd=socket(AF_INET,SOCK
serv.sin_family=AF_INET;
serv.sin_port=htons(3333);
serv.sin_addr.s_addr=inet_
ret=connect(sockfd,(struct
ret=send(sockfd,senddata,l
}
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
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