Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
d34f2a43
Commit
d34f2a43
authored
8 years ago
by
Muxi Yan
Browse files
Options
Downloads
Patches
Plain Diff
Better strategy
parent
1cef41f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
+10
-18
10 additions, 18 deletions
src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
with
10 additions
and
18 deletions
src/objective-c/tests/CronetUnitTests/CronetUnitTests.m
+
10
−
18
View file @
d34f2a43
...
...
@@ -34,7 +34,6 @@
#import <XCTest/XCTest.h>
#import <netinet/in.h>
#import <sys/socket.h>
#import <sys/fcntl.h>
#import <Cronet/Cronet.h>
#import <grpc/grpc.h>
...
...
@@ -197,7 +196,6 @@ unsigned int parse_h2_length(const char *field) {
s_addr
.
sin_family
=
AF_INET
;
s_addr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
s_addr
.
sin_port
=
htons
(
port
);
GPR_ASSERT
(
-
1
!=
fcntl
(
sl
,
F_SETFL
,
fcntl
(
sl
,
F_GETFL
,
0
)
|
O_NONBLOCK
));
GPR_ASSERT
(
0
==
bind
(
sl
,
(
struct
sockaddr
*
)
&
s_addr
,
sizeof
(
s_addr
)));
GPR_ASSERT
(
0
==
listen
(
sl
,
5
));
...
...
@@ -240,10 +238,6 @@ unsigned int parse_h2_length(const char *field) {
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
fd_set
fs
;
FD_ZERO
(
&
fs
);
FD_SET
(
sl
,
&
fs
);
select
(
sl
+
1
,
&
fs
,
NULL
,
NULL
,
NULL
);
int
s
=
accept
(
sl
,
NULL
,
NULL
);
GPR_ASSERT
(
s
>=
0
);
...
...
@@ -331,17 +325,18 @@ unsigned int parse_h2_length(const char *field) {
__weak
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
@"Coalescing"
];
int
sl
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
GPR_ASSERT
(
sl
>=
0
);
struct
sockaddr_in
s_addr
;
memset
(
&
s_addr
,
0
,
sizeof
(
s_addr
));
s_addr
.
sin_family
=
AF_INET
;
s_addr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
s_addr
.
sin_port
=
htons
(
port
);
GPR_ASSERT
(
0
==
bind
(
sl
,
(
struct
sockaddr
*
)
&
s_addr
,
sizeof
(
s_addr
)));
GPR_ASSERT
(
0
==
listen
(
sl
,
5
));
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
int
sl
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
GPR_ASSERT
(
sl
>=
0
);
struct
sockaddr_in
s_addr
;
memset
(
&
s_addr
,
0
,
sizeof
(
s_addr
));
s_addr
.
sin_family
=
AF_INET
;
s_addr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
s_addr
.
sin_port
=
htons
(
port
);
GPR_ASSERT
(
0
==
bind
(
sl
,
(
struct
sockaddr
*
)
&
s_addr
,
sizeof
(
s_addr
)));
GPR_ASSERT
(
0
==
listen
(
sl
,
5
));
int
s
=
accept
(
sl
,
NULL
,
NULL
);
GPR_ASSERT
(
s
>=
0
);
struct
timeval
tv
;
...
...
@@ -396,9 +391,6 @@ unsigned int parse_h2_length(const char *field) {
[
expectation
fulfill
];
});
// Guarantees that server is listening to the port before client connects.
sleep
(
1
);
memset
(
ops
,
0
,
sizeof
(
ops
));
op
=
ops
;
op
->
op
=
GRPC_OP_SEND_INITIAL_METADATA
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment