当前位置: 技术问答>linux和unix
奇怪的段错误,高手帮忙啊,送上30分
来源: 互联网 发布时间:2015-12-06
本文导语: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define BUFFSIZE 2048 void Die(char *mess) { perror(mess); ...
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define BUFFSIZE 2048
void Die(char *mess)
{
perror(mess);
exit(1);
}
int main(int argc,char *argv[])
{
int sock,i,k;
struct sockaddr_in echoserver;
char buff[BUFFSIZE];
unsigned int echolen;
int received = 0;
if(argc != 4)
{
fprintf(stderr,"USAGE: TCPechon");
exit(1);
}
//Create the TCP socket
if((sock = socket(PF_INET,SOCK_STREAM,IPPROTO_TCP))
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define BUFFSIZE 2048
void Die(char *mess)
{
perror(mess);
exit(1);
}
int main(int argc,char *argv[])
{
int sock,i,k;
struct sockaddr_in echoserver;
char buff[BUFFSIZE];
unsigned int echolen;
int received = 0;
if(argc != 4)
{
fprintf(stderr,"USAGE: TCPechon");
exit(1);
}
//Create the TCP socket
if((sock = socket(PF_INET,SOCK_STREAM,IPPROTO_TCP))