public List <Post> GetPostsFromLastDate(DateTime dt, Friend friend) { for (int i = 1; i <= Config.Instance.NumberOfReplicas; i++) { ServerToServerServices obj = (ServerToServerServices)Activator.GetObject(typeof(ServerToServerServices), friend.Address + ":" + (friend.Port + i) + "/ServerToServerServices"); if (obj != null) { try { return(obj.GetPostsFromLastDate(dt)); } catch (IOException) { } catch (SocketException) { } } } throw new ServiceUnavailableException("Could not notify user of acceptance."); }
public void RejectFriendRequest(FriendRequest fr) { for (int i = 1; i <= Config.Instance.NumberOfReplicas; i++) { ServerToServerServices obj = (ServerToServerServices)Activator.GetObject(typeof(ServerToServerServices), fr.FromAddress + ":" + (fr.FromPort + i) + "/ServerToServerServices"); if (obj != null) { try { obj.RejectFriendRequest(fr); return; } catch (IOException) { } catch (SocketException) { } } } throw new ServiceUnavailableException("Could not notify user of rejection."); }
public void SendFriendRequest(FriendRequest fr) { for (int i = 1; i <= Config.Instance.NumberOfReplicas; i++) { ServerToServerServices obj = (ServerToServerServices)Activator.GetObject(typeof(ServerToServerServices), fr.SendTo + ":" + (fr.SendToPort + i) + "/ServerToServerServices"); if (obj != null) { try { obj.ReceiveFriendRequest(fr); return; } catch (IOException) { } catch (SocketException) { } } } throw new ServiceUnavailableException("Could not deliver friend request, please try again later."); }
public void AcceptFriendRequest(FriendRequest fr) { Profile profile = (Profile)ServerManager.Instance.ServerInstance.ReadDomainObject("Profile"); fr.RequestedUserName = profile.UserName; for (int i = 1; i <= Config.Instance.NumberOfReplicas; i++) { ServerToServerServices obj = (ServerToServerServices)Activator.GetObject(typeof(ServerToServerServices), fr.FromAddress + ":" + (fr.FromPort + i) + "/ServerToServerServices"); if (obj != null) { try { obj.AcceptFriendRequest(fr); return; } catch (IOException) { } catch (SocketException) { } } } throw new ServiceUnavailableException("Could not notify user of acceptance."); }