public async Task BindAsync() { await _transport.BindAsync(); try { await _broadcast.BindAsync(); } catch (AddressInUseException) { _trace.AddressInUse(); } _trace.Bind(_transport.EndPoint); await _broadcast.SendToAsync(ToBuffer("Broadcast:" + _id + ":" + _transport.EndPoint.Port)); }
public async Task BindAsync() { await _transport.BindAsync(); try { await _broadcast.BindAsync(); } catch (AddressInUseException) { _trace.AddressInUse(); } _trace.Bind(_transport.EndPoint); var socketError = await _broadcast.SendToAsync(new ArraySegment <byte>(ToBytes("Broadcast:" + _id + ":" + _transport.EndPoint.Port))); if (socketError != SocketError.Success) { _trace.LogError($"broadcast.SendToAsync() failed: {socketError}"); } }