mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-27 19:12:56 +01:00
Fix wrong service to socket binding
This commit is contained in:
parent
dba86fbbf8
commit
741b3fb1c0
12
CHANGES.md
12
CHANGES.md
@ -2,10 +2,20 @@
|
||||
|
||||
## [0.2.2] - 2018-11-14
|
||||
|
||||
* Refactor Connector and Resolver services
|
||||
### Added
|
||||
|
||||
* Add low/high caps to Framed
|
||||
|
||||
### Changed
|
||||
|
||||
* Refactor Connector and Resolver services
|
||||
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fix wrong service to socket binding
|
||||
|
||||
|
||||
## [0.2.0] - 2018-11-08
|
||||
|
||||
### Added
|
||||
|
@ -40,7 +40,9 @@ impl Message for StopServer {
|
||||
pub(crate) struct Token(usize);
|
||||
|
||||
impl Token {
|
||||
pub(crate) fn next(&self) -> Token {
|
||||
Token(self.0 + 1)
|
||||
pub(crate) fn next(&mut self) -> Token {
|
||||
let token = Token(self.0 + 1);
|
||||
self.0 += 1;
|
||||
token
|
||||
}
|
||||
}
|
@ -144,8 +144,15 @@ impl Server {
|
||||
{
|
||||
let sockets = bind_addr(addr)?;
|
||||
|
||||
let token = self.token.next();
|
||||
self.services.push(StreamNewService::create(
|
||||
name.as_ref().to_string(),
|
||||
token,
|
||||
factory,
|
||||
));
|
||||
|
||||
for lst in sockets {
|
||||
self = self.listen(name.as_ref(), lst, factory.clone())
|
||||
self.sockets.push((token, lst));
|
||||
}
|
||||
Ok(self)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user