@@ -51,7 +51,7 @@ public static void bindingExample() throws Exception {
51
51
Materializer materializer = Materializer .createMaterializer (system );
52
52
53
53
Source <IncomingConnection , CompletionStage <ServerBinding >> serverSource =
54
- Http .get (system ).bind ( ConnectHttp . toHost ( "localhost" , 8080 ));
54
+ Http .get (system ).newServerAt ( "localhost" , 8080 ). connectionSource ( );
55
55
56
56
CompletionStage <ServerBinding > serverBindingFuture =
57
57
serverSource
@@ -73,7 +73,7 @@ public static void bindingFailureExample() throws Exception {
73
73
Materializer materializer = Materializer .createMaterializer (system );
74
74
75
75
Source <IncomingConnection , CompletionStage <ServerBinding >> serverSource =
76
- Http .get (system ).bind ( ConnectHttp . toHost ( "localhost" , 80 ));
76
+ Http .get (system ).newServerAt ( "localhost" , 80 ). connectionSource ( );
77
77
78
78
CompletionStage <ServerBinding > serverBindingFuture =
79
79
serverSource
@@ -101,7 +101,7 @@ public static void connectionSourceFailureExample() throws Exception {
101
101
Materializer materializer = Materializer .createMaterializer (system );
102
102
103
103
Source <IncomingConnection , CompletionStage <ServerBinding >> serverSource =
104
- Http .get (system ).bind ( ConnectHttp . toHost ( "localhost" , 8080 ));
104
+ Http .get (system ).newServerAt ( "localhost" , 8080 ). connectionSource ( );
105
105
106
106
Flow <IncomingConnection , IncomingConnection , NotUsed > failureDetection =
107
107
Flow .of (IncomingConnection .class )
@@ -137,7 +137,7 @@ public static void connectionStreamFailureExample() throws Exception {
137
137
Materializer materializer = Materializer .createMaterializer (system );
138
138
139
139
Source <IncomingConnection , CompletionStage <ServerBinding >> serverSource =
140
- Http .get (system ).bind ( ConnectHttp . toHost ( "localhost" , 8080 ));
140
+ Http .get (system ).newServerAt ( "localhost" , 8080 ). connectionSource ( );
141
141
142
142
Flow <HttpRequest , HttpRequest , NotUsed > failureDetection =
143
143
Flow .of (HttpRequest .class )
@@ -186,7 +186,7 @@ public static void fullServerExample() throws Exception {
186
186
final Materializer materializer = Materializer .createMaterializer (system );
187
187
188
188
Source <IncomingConnection , CompletionStage <ServerBinding >> serverSource =
189
- Http .get (system ).bind ( ConnectHttp . toHost ( "localhost" , 8080 ));
189
+ Http .get (system ).newServerAt ( "localhost" , 8080 ). connectionSource ( );
190
190
191
191
// #request-handler
192
192
final Function <HttpRequest , HttpResponse > requestHandler =
@@ -379,10 +379,8 @@ public static void gracefulTerminationExample() throws Exception {
379
379
380
380
CompletionStage <ServerBinding > binding =
381
381
Http .get (system )
382
- .bindAndHandle (
383
- Directives .complete ("Hello world!" ).flow (system , materializer ),
384
- ConnectHttp .toHost ("localhost" , 8080 ),
385
- materializer );
382
+ .newServerAt ("localhost" , 8080 )
383
+ .bindFlow (Directives .complete ("Hello world!" ).flow (system , materializer ));
386
384
387
385
ServerBinding serverBinding = binding .toCompletableFuture ().get (3 , TimeUnit .SECONDS );
388
386
0 commit comments