Commit 26b05122 authored by wangdong's avatar wangdong

delete changes

parent df8b9363
......@@ -967,40 +967,40 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
}
}
//建立Socket链接,并存放在RC.sockfd中
//然后就是创建Socket连接,并发送
static int flag =0;
#define MAXLINE 800000
#define SER_PORT 23333
int buffer = 0;
if(flag==0){
LOG_I(MAC,"[SOCKET]Socket \n");
struct sockaddr_in servaddr;
int sockfd = 0;
sockfd = socket(AF_INET, SOCK_STREAM, 0);
RC.sockfd = sockfd;
printf("[SOCKET]Socket ID :&RC.mac[Mod_id]->sockfd= %d\n", RC.sockfd); //buffer = sockfd;
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
inet_pton(AF_INET, "127.0.0.1", &servaddr.sin_addr);
servaddr.sin_port = htons(SER_PORT);
if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
{
printf("[SOCKET]connet error:%s\n", strerror(errno));
} //链接服务器
else{
flag = flag +1;
int num;
char *json_data = NULL;
json_data = "Begin Connection to Python Server";
int n = strlen(json_data);
char buf[MAXLINE];
write(sockfd, json_data, n);
read(sockfd, buf, MAXLINE);
printf("[SOCKET]Response from server: %s\n", buf);
}
}
// //建立Socket链接,并存放在RC.sockfd中
// //然后就是创建Socket连接,并发送
// static int flag =0;
// #define MAXLINE 800000
// #define SER_PORT 23333
// int buffer = 0;
// if(flag==0){
// LOG_I(MAC,"[SOCKET]Socket \n");
// struct sockaddr_in servaddr;
// int sockfd = 0;
// sockfd = socket(AF_INET, SOCK_STREAM, 0);
// RC.sockfd = sockfd;
// printf("[SOCKET]Socket ID :&RC.mac[Mod_id]->sockfd= %d\n", RC.sockfd); //buffer = sockfd;
// bzero(&servaddr, sizeof(servaddr));
// servaddr.sin_family = AF_INET;
// inet_pton(AF_INET, "127.0.0.1", &servaddr.sin_addr);
// servaddr.sin_port = htons(SER_PORT);
// if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
// {
// printf("[SOCKET]connet error:%s\n", strerror(errno));
// } //链接服务器
// else{
// flag = flag +1;
// int num;
// char *json_data = NULL;
// json_data = "Begin Connection to Python Server";
// int n = strlen(json_data);
// char buf[MAXLINE];
// write(sockfd, json_data, n);
// read(sockfd, buf, MAXLINE);
// printf("[SOCKET]Response from server: %s\n", buf);
// }
// }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment