private IAsyncResult RemoteAsyncCallView(TupleSpace space) { AsyncViewDelegate RemoteDel = new AsyncViewDelegate(space.RequestView); IAsyncResult RemAr = RemoteDel.BeginInvoke(null, null); return(RemAr); }
private IAsyncResult RemoteAsyncCallAdd(TupleSpace space, ITuple tuple, string id, int seq) { AsyncAddDelegate RemoteDel = new AsyncAddDelegate(space.Add); IAsyncResult RemAr = RemoteDel.BeginInvoke(tuple, id, seq, RemoteAsyncCallBackAdd, null); return(RemAr); }
private IAsyncResult RemoteAsyncCallTakeRemove(TupleSpace space, ITuple tuple, HashSet <ITuple> locked, string id, int seq) { AsyncTakeRemoveDelegate RemoteDel = new AsyncTakeRemoveDelegate(space.TakeRemove); IAsyncResult RemAr = RemoteDel.BeginInvoke(tuple, locked, id, seq, RemoteAsyncCallBackTakeRemove, null); return(RemAr); }
private IAsyncResult RemoteAsyncCallUnlock(TupleSpace space, HashSet <ITuple> locked, string id, int seq) { AsyncUnlockDelegate RemoteDel = new AsyncUnlockDelegate(space.Unlock); IAsyncResult RemAr = RemoteDel.BeginInvoke(locked, id, seq, RemoteAsyncCallBackUnlock, null); return(RemAr); }
private IAsyncResult RemoteAsyncCallTakeSelect(TupleSpace space, ISchema schema, string id, int seq) { AsyncTakeSelectDelegate RemoteDel = new AsyncTakeSelectDelegate(space.TakeSelect); IAsyncResult RemAr = RemoteDel.BeginInvoke(schema, id, seq, null, null); return(RemAr); }
private IAsyncResult RemoteAsyncCallContinue(TupleSpace space) { AsyncContinueDelegate RemoteDel = new AsyncContinueDelegate(space.Continue); IAsyncResult RemAr = RemoteDel.BeginInvoke(null, null); return(RemAr); }
private IAsyncResult RemoteAsyncCallStop(TupleSpace space) { AsyncStopDelegate RemoteDel = new AsyncStopDelegate(space.Stop); IAsyncResult RemAr = RemoteDel.BeginInvoke(null, null); return(RemAr); }
private IAsyncResult RemoteAsyncCallAsk(TupleSpace space) { AsyncAskDelegate RemoteDel = new AsyncAskDelegate(space.RequestData); IAsyncResult RemAr = RemoteDel.BeginInvoke(null, null); return(RemAr); }
public void Update() { string copyUrl = null; while (copyUrl == null) { copyUrl = viewManager.RequestView().First(); } TupleSpace copySpace = (TupleSpace)otherTupleSpaces[copyUrl]; bool Stopped = copySpace.Stop(); if (!Stopped) { return; } UpdateLatest(copySpace.RequestData()); copySpace.Continue(); }
public ServerApi(string id, string url, int minDelay, int maxDelay, List <String> urls) { int port = DU.ExtractPortFromUrl(url); TcpChannel Channel = new TcpChannel(DU.ExtractPortFromUrl(url)); ChannelServices.RegisterChannel(Channel, false); Dictionary <string, Pingable> TupleSpaces = new Dictionary <string, Pingable>(); string selfURL = ""; foreach (string serverUrl in urls) { if (port != DU.ExtractPortFromUrl(serverUrl)) { Console.WriteLine(serverUrl); TupleSpaces.Add(serverUrl, (TupleSpace)Activator.GetObject(typeof(TupleSpace), serverUrl)); } else { selfURL = serverUrl; } } TupleSpace tupleSpace = new TupleSpace(selfURL, minDelay, maxDelay, TupleSpaces); RemotingServices.Marshal(tupleSpace, DU.ExtractObjectNameFromUrl(url)); tupleSpace.Stopped = true; List <TupleSpace> tupleSpaces = new List <TupleSpace>(); foreach (var entry in TupleSpaces) { tupleSpaces.Add((TupleSpace)entry.Value); } tupleSpace.Update(); tupleSpace.Stopped = false; Console.WriteLine("Enter to exit"); Console.ReadLine(); }