Closed Class for array (or list) of clients

This project was awarded to FalconCoders for $49 USD.

Get free quotes for a project like this
Employer working
Awarded to:
Skills Required
Project Budget
Total Bids
Project Description

I have a (hopefully) simple program for a [url removed, login to view] programmer to create for me, the idea is that a program will be written that includes a communications class, and a console example program identifying how to use the class in applications. This is so i can intergrate this solution into my own system.

Language [url removed, login to view], Budget $50

I need you to create a multi-threaded client, which establishes asyncronous connections to seperate servers, and keeps those connections alive. There should be retry capacity, so that it tries to connect, and if it works it says the client is connected in console, if it does not it reports an error, and tries again later (indefinatally under that one thread specific to the client that could not connect).

E.g. Client IP Address: Port connected
e.g. Client IP Address: Port disconnected

The server devices your client would be connected to would actually be XBMC devices, each with their own IP address, seperate usernames and passwords etc, I assume storing these variables in an arraylist would be most appropiate, and your system would go through the list and establish a connection to each client on that list (the list will vary in number, so your solution needs to be able to handle greater than 10 client to server connections).

Once the client is connected, the stream from each server should be monitored, and sent to a callback section, where the client it came from (say IP address) can be easily stored, along with the message. In the demo the client should report in the console

New message from indexNo (e.g. Socket1) IP address: Message

The system should also be able to handle sending messages to the client, and recieving a response from that specific message, e.g. a message could be sent to the client through SendMessageSocket(SocketNo as Integer, strMessage as string)
SendMessageIndex(IndexNo as Integer, strMessage as string)

These examples would send the same message, just one would send it based on the socket number (or TCP client no), whilst the other would send it to the client based on the array list.
(The idea being a simple way to ask the server for more information on data receipt)


When connected to the server, if something happens the server would send the message:

{"jsonrpc":"2.0","method":"[url removed, login to view]","params":{"data":{"item":{"id":29,"type":"episode"},"player":{"playerid":1,"speed":0}},"sender":"xbmc"}}

On receipt of this message, your application would store the client number it came from, IP address etc, and we could in response then ask the server:

{"jsonrpc":"2.0","method":"[url removed, login to view]","params":{"playerid":1,"properties":["title"]},"id":29}

The server would then respond with:
{"id":29,"jsonrpc":"2.0","result":{"item":{"id":29,"label":"Tony Kushner","title":"Tony Kushner","type":"episode"}}}

Your system would then return an array or string which includes the client the message came from and the response, so if we were to send:

SendMessageSocket(1,"{"jsonrpc":"2.0","method":"[url removed, login to view]","params":{"playerid":1,"properties":["title"]},"id":29}") the client would return the string

[1][{"id":29,"jsonrpc":"2.0","result":{"item":{"id":29,"label":"Tony Kushner","title":"Tony Kushner","type":"episode"}}}]

where [1] is the socket or index number, and the rest is the string returned from the server the message was sent to.

So to recap, from you I would like a class which handles communication betweeen multiple TCP clients (each with their own thread) connecting to seperate servers based on connection information within an array. Including handling disconnections and reconnections to each client, and the ability to read information asyncronously from each client, process that information (including knowing which client it came from), and also sending information to each client, and being able to handle responses from each client (whilst still in that clients specific thread).

The code needs to be well commented, as i also want to use your code to learn!

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online