public RabbitMQConnectionBuilder(IPEndPoint endpoint) { ConnInfo = RabbitMQConnectionInfo.DefaultConnectionInfo(); ClientInfo = RabbitMQClientInfo.DefaultClientInfo(); MainInfo = RabbitMQMainInfo.DefaultConnectionInfo(); Endpoint = endpoint; }
internal RabbitMQChannelZero(RabbitMQConnectionBuilder builder, RabbitMQProtocol protocol) : base(protocol) { MainInfo = builder.MainInfo; ClientInfo = builder.ClientInfo; _connectionInfo = builder.ConnInfo; _channelId = 0; _isOpen = false; }
private async ValueTask HandleMethod(MethodHeader method) { Debug.Assert(method.ClassId == 10); switch (method.ClassId) { case 10 when method.MethodId == 10: { ServerInfo = await ReadStartAsync().ConfigureAwait(false); await SendStartOk(ClientInfo, _connectionInfo).ConfigureAwait(false); break; } case 10 when method.MethodId == 30: { MainInfo = await ProcessTuneMethodAsync().ConfigureAwait(false); await SendTuneOk(MainInfo).ConfigureAwait(false); await SendOpen(_connectionInfo.VHost).ConfigureAwait(false); break; } case 10 when method.MethodId == 41: { _isOpen = await ReadOpenOkAsync().ConfigureAwait(false); _openOkSrc.SetResult(_isOpen); break; } case 10 when method.MethodId == 50: //close-ok { break; } default: throw new Exception($"{nameof(RabbitMQChannelZero)}:cannot read frame (class-id,method-id):({method.ClassId},{method.MethodId})"); } }