Example #1
0
        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));
        }
Example #2
0
        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}");
            }
        }