Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AIEngine
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AIEngine
Commits
26b05122
Commit
26b05122
authored
Nov 07, 2020
by
wangdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete changes
parent
df8b9363
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
openair2/LAYER2/MAC/eNB_scheduler.c
openair2/LAYER2/MAC/eNB_scheduler.c
+33
-33
No files found.
openair2/LAYER2/MAC/eNB_scheduler.c
View file @
26b05122
...
...
@@ -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);
//
}
//
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment