Find Jobs
Hire Freelancers

Modify an old android based project

$30-250 USD

已关闭
已发布超过 11 年前

$30-250 USD

货到付款
Introduction Before reading further, you may wish to review the general project description from Old project: You can use this OLD PROJECT SOLUTION as your starting point. There is no change to the client side of the code. Follow the instructions in Oldproject to prepare and run your code. Only the server needs to be changed for this project. Creating the Request Matcher For this project, you will create a concurrent request-response matcher. In old project , every time a request or response is submitted, the server checks if the request/response can be assigned and if not possible, it was added to an internal list. For Project 8, we separate this into two different tasks, each to be executed as a thread. For this project the server will have two threads of execution. We will call them Listener thread and Matcher thread. The Listener is your 'main' thread. The Listener will listen for incoming connections. When it receives a request/response, the server adds it to either the request or response list and goes back to listening. In other words, this thread does NOT do any scheduling or matching. When the server starts, you need to create a new thread(the Matcher thread) that will monitor the set of requests and responses every 'x' seconds. This Matcher thread will wake up after 'x' seconds and check both request and response lists. If there are values in the request list that can be matched with a response, it will perform the matching - that is assign the request to the response. The Matcher thread will try to match all requests with responses before going back to sleep again. Implementation Server You should modify your Server class from Old project. The server should start a Matcher thread(see below) when it starts. Also you should modify your server logic in such a way that when messages are received, it is added to the request or response list and no assignment or matching happens. Your server should also take in two extra parameters from the command line - matching type and sleep time. This means now your server takes in 3 command line parameters java Server port matchtype sleep. eg: java Server 1234 FCFS 1000 means start the server at port 1234, with matching type FCFS and a sleep time of 1000 milli seconds. DataFeeder Interface Create a new interface DataFeeder with the code given below in the appropriate folder. Note the package structure and make sure your folder structure matches it. package ll give you public interface DataFeeder { a pseudo code will be provided; } Matcher Thread 'f', An implementation of DataFeeder interface. 'sleep', the sleep interval for the thread in milli seconds. 'matchingType', The type of matching to be performed. 'channel', The channel you have defined and initialized in the server. By using this, you can send messages to the responder and requester after each assignment. Every time the matcher thread wakes up, it calls methods in DataFeeder interface to assign requests to a response. If it cannot find a match, it will just go back to sleep. The thread keeps on matching as many requests and responses as possible. Once it has matched all possibilities, it goes back to sleep. You have to implement two kinds of matchers, FCFS in which the first request is matched with the first response and MostRecent in which the last request is matched with the last response first. package will be provided public class Matcher extends Thread { a pseudo code will be provided } } DataFeeder Implementation You need to create one class that implements the DataFeeder interface. This class should have request and response lists into which the main Listener thread keeps adding entries. Synchronization Issues You can use synchronized block/methods or use thread safe data structures like vectors to ensure this.
项目 ID: 3997142

关于此项目

4提案
远程项目
活跃11 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
4威客以平均价$185 USD来参与此工作竞价
用户头像
Hello, I have many years of experience in this field. Can you explain better what do you need for this project? I think that in 20 days i can give you the result . regards
$200 USD 在20天之内
0.0 (0条评论)
0.0
0.0
用户头像
We are freelance software developers. If you contact me I can give a quote for your project and we can discuss the details. <b><i>Removed by Admin</i></b>
$140 USD 在1天之内
0.0 (0条评论)
0.0
0.0
用户头像
Hello Sir, I can do this task.
$200 USD 在30天之内
0.0 (0条评论)
0.0
0.0
用户头像
Hi, I have 5 years of exp. in java/j2ee development.I would like to take up this project.
$200 USD 在20天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
United States
0.0
0
会员自11月 12, 2012起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。