internal override void AddServiceClientLink(IServiceClientLink iServiceClientLink) { lock (gate) { clientLinks.Add(iServiceClientLink); } }
internal override void RemoveServiceClientLink(IServiceClientLink iServiceClientLink) { lock (gate) { clientLinks.Remove(iServiceClientLink); } }
public override void processRequest(ref byte[] buf, int num_bytes, IServiceClientLink link) { var cb = new ServiceCallback(this, helper, buf, num_bytes, link, has_tracked_object, tracked_object); this.callbackId = cb.Uid; callback.AddCallback(cb); }
public override Task <(RosMessage, bool)> ProcessRequest(byte[] buf, IServiceClientLink link) { var cb = new ServiceCallback(this, helper, buf, link); callback.AddCallback(cb, gate); return(cb.ResultTask); }
private async Task StartReadHeader(Connection connection) { try { var headerFields = await connection.ReadHeader(cancel); if (headerFields.ContainsKey("topic")) { TransportSubscriberLink subscriberLink = new TransportSubscriberLink(); subscriberLink.Initialize(connection, new Header(headerFields)); } else if (headerFields.ContainsKey("service")) { IServiceClientLink serviceClientLink = new IServiceClientLink(); serviceClientLink.Initialize(connection, new Header(headerFields)); } else { throw new RosException("Received a connection for a type other than topic or service."); } } catch (Exception e) { logger.LogWarning(e, e.Message); connection.Dispose(); } }
public ServiceCallback(ServicePublication <MReq, MRes> sp, ServiceCallbackHelper <MReq, MRes> _helper, byte[] buf, int num_bytes, IServiceClientLink link, bool has_tracked_object, object tracked_object) { this.isp = sp; if (this.isp != null && _helper != null) { this.isp.helper = _helper; } this.buffer = buf; this._numBytes = num_bytes; this.link = link; this._hasTrackedObject = has_tracked_object; this._trackedObject = tracked_object; }
public bool OnConnectionHeaderReceived(Connection conn, Header header) { bool ret = false; if (header.Values.ContainsKey("topic")) { TransportSubscriberLink sub_link = new TransportSubscriberLink(); ret = sub_link.Initialize(conn); ret &= sub_link.HandleHeader(header); } else if (header.Values.ContainsKey("service")) { IServiceClientLink iscl = new IServiceClientLink(); ret = iscl.initialize(conn); ret &= iscl.handleHeader(header); } else { ROS.Warn()($"[{ThisNode.Name}] Got a connection for a type other than topic or service from [{conn.RemoteString}]."); return(false); } //ROS.Debug()( $"[{ThisNode.Name}] CONNECTED [{val}]. WIN." ); return(ret); }
public ServiceCallback(ServicePublication <MReq, MRes> sp, ServiceCallbackHelper <MReq, MRes> _helper, byte[] buf, IServiceClientLink link) { this.isp = sp; if (this.isp != null && _helper != null) { this.isp.helper = _helper; } this.buffer = buf; this.link = link; }
public ServiceCallback(ServiceCallbackHelper <MReq, MRes> _helper, byte[] buf, IServiceClientLink link) : this(null, _helper, buf, link) { }
public ServiceCallback(ServiceCallbackHelper <MReq, MRes> _helper, byte[] buf, int num_bytes, IServiceClientLink link, bool has_tracked_object, object tracked_object) : this(null, _helper, buf, num_bytes, link, has_tracked_object, tracked_object) { }
internal override void removeServiceClientLink(IServiceClientLink iServiceClientLink) { lock (client_links_mutex) client_links.Remove(iServiceClientLink); }
internal override void addServiceClientLink(IServiceClientLink iServiceClientLink) { lock (client_links_mutex) client_links.Add(iServiceClientLink); }
public abstract void processRequest(ref byte[] buffer, int size, IServiceClientLink iServiceClientLink);
internal abstract void removeServiceClientLink(IServiceClientLink iServiceClientLink);
internal abstract void addServiceClientLink(IServiceClientLink iServiceClientLink);