public virtual async void Notify(NotifyInfo notifyInfo, BAsyncResult <Object> asyncResult) { Object __byps__ret = default(Object); Exception __byps__ex = null; bool __byps__callAsync = false; try { Notify(notifyInfo); } catch (NotImplementedException) { __byps__callAsync = true; } catch (Exception e) { __byps__ex = e; } if (__byps__callAsync) { try { await NotifyAsync(notifyInfo); } catch (NotImplementedException) { __byps__ex = new BException(BExceptionC.UNSUPPORTED_METHOD, ""); } }
public virtual async void FindFiles(String path, FindOptions findOptions, BAsyncResult <IList <FileInfo> > asyncResult) { IList <FileInfo> __byps__ret = default(IList <FileInfo>); Exception __byps__ex = null; bool __byps__callAsync = false; try { __byps__ret = FindFiles(path, findOptions); } catch (NotImplementedException) { __byps__callAsync = true; } catch (Exception e) { __byps__ex = e; } if (__byps__callAsync) { try { __byps__ret = await FindFilesAsync(path, findOptions); } catch (NotImplementedException) { __byps__ex = new BException(BExceptionC.UNSUPPORTED_METHOD, ""); } }
public virtual async void IncrementInt(int a, BAsyncResult <int> asyncResult) { int __byps__ret = default(int); Exception __byps__ex = null; bool __byps__callAsync = false; try { __byps__ret = IncrementInt(a); } catch (NotImplementedException) { __byps__callAsync = true; } catch (Exception e) { __byps__ex = e; } if (__byps__callAsync) { try { __byps__ret = await IncrementIntAsync(a); } catch (NotImplementedException) { __byps__ex = new BException(BExceptionC.UNSUPPORTED_METHOD, ""); } }
private void internalCreateConnection(IXAuthentication auth, BAsyncResult <IXConnection> asyncResult) { // Check version if (MajorVersion < 9) { BException ex = new BException(BExceptionC.CONNECTION_TO_SERVER_FAILED, "Received server version " + Version + ". At least server version 9.00.000 is required."); asyncResult(null, ex); return; } // IX-URL, e.g. http://localhost:8084/ix-elo80/ix String url = connProps[PROP_URL]; // BYPS-URL, e.g. http://localhost:8084/ix-elo80/byps String bypsUrl = url; int pos = bypsUrl.LastIndexOf("/ix"); if (pos >= 0) { bypsUrl = bypsUrl.Substring(0, pos) + "/byps"; if (pos + 3 < url.Length) { bypsUrl += url.Substring(pos + 3); } } // timeout String timeoutSecondsStr = connProps[PROP_TIMEOUT_SECONDS]; int timeoutSeconds = Convert.ToInt32(timeoutSecondsStr != null && timeoutSecondsStr.Length != 0 ? timeoutSecondsStr : "120"); // #reverse connections String reverseConnsStr = connProps[NB_OF_REVERSE_CNNS]; int nbOfReverseConnections = Convert.ToInt32(reverseConnsStr != null && reverseConnsStr.Length != 0 ? reverseConnsStr : "1"); // Wire, transport, client IXWireClient wire = new IXWireClient(bypsUrl, 0, timeoutSeconds); BTransportFactory transportFactory = new HTransportFactoryClient(BApiDescriptor_Indexserver.instance, wire, nbOfReverseConnections); BClient_Indexserver bclient = BClient_Indexserver.createClient(transportFactory); // Authentication bclient.setAuthentication(auth); // IXConnection IXConnection conn = new IXConnection(this, bclient, auth, url, connProps, sessOpts); BAsyncResult <bool> outerResult = (ignored, e) => { if (e != null) { asyncResult(conn, e); } else if (this.CONST != null) { asyncResult(conn, e); } else { // Read constants BAsyncResult <IXServicePortC> constResult = (CONST, ex) => { this.CONSTVal = CONST; asyncResult(conn, ex); }; conn.getCONST(constResult); } }; // Start client bclient.start(outerResult, false); }