Recent Changes - Search:
ECG Home

GitHub

People

Publications

Calendar

Projects

Fall 2017

Older Courses

Spring 2017

Fall 2016

Spring 2016

Fall 2015

Spring 2015

Fall 2014

Spring 2014

Fall 2013

Spring 2013

Fall 2012

Spring 2012

Fall 2011

Spring 2011

Fall 2010

Spring 2010

Fall 2009

Spring 2009

Fall 2008

Spring 2008

Fall 2007

HOWTOs

edit SideBar

Network Protocol Demo (Feb 11 2008)

This is the first working network protocol demo for iSENSE. The main() method itself is contained in the SampleApplication class. The server begins by listening on port 12345. When a client accepts a connection, the new connection is handed off to a new Thread object. From there, all server activity takes place in the iSENSE.Server class, from message handling to user authentication to error handling. The client executes commands from the client Thread in the SampleApplication class, but all the "heavy lifting" is done by the iSENSE.Client class API.

An overview of the basic network protocol is in the PDF file I attached. Basically, every client request takes the form of a Message object, with typed parameters depending on the request being executed. When the server receives the client's request, it can either response with a success or failure Message object.

The sample application's server attempts to connect to a MySQL server on the local machine on the default port. You must either change the server and setup the correct database structure, or you could setup a local MySQL server and create the correct database structure. Either way, your database must have the following structure:

CREATE TABLE `data` (
  `id` int(11) NOT NULL auto_increment,
  `fid` int(11) NOT NULL,
  `eid` int(11) NOT NULL,
  `data` text NOT NULL,
  `timestamp` bigint(20) NOT NULL,
  KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT;
CREATE TABLE `experiments` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(64) NOT NULL,
  `user` varchar(32) NOT NULL,
  KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT;
CREATE TABLE `fields` (
  `id` int(11) NOT NULL auto_increment,
  `eid` int(11) NOT NULL,
  `name` varchar(64) NOT NULL,
  `type` int(11) NOT NULL,
  KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT;

The server must also be configured for connecting to a MySQL database using JDBC. Read the MySQL documentation for more information on doing this. It's really just a small download and JAR file that you need.

As we discussed in class, this protocol will almost certainly be modified at some point in the not-so-distant future. For now, it looks like this is what we will be using for our protocol though. If you have questions about anything in the protocol or example code, please email me (wbrendel AT cs DOT uml DOT edu).

Files

Edit - History - Print - Recent Changes - Search
Page last modified on February 12, 2008, at 03:54 AM