SecurePlayLibray J2SE
v2.1

com.SecurePlay.Comms.SPCcommsHTTP
Class SocketConnectionHTTP

java.lang.Object
  extended bycom.SecurePlay.Comms.SPCcommsHTTP.SocketConnectionHTTP

public class SocketConnectionHTTP
extends java.lang.Object

This class represents an HTTP connection. It also spawns a HTTP listener class in a seperate thread that listens incoming messages. It is also used to send messages out. The reason for this class existence is that a connection can be stored in a map and grabbed to send messages whenever, while the listener it spawned listens to messages.

Author:
IT GlobalSecure
See Also:
SecurePlay License Information
 

Field Summary
(package private)  java.net.Socket client
          This is the socket connection.
(package private)  SPCcommsHTTP httpMain
          This is the main HTTP driver class that this connection is associated to.
(package private)  java.io.OutputStream out
          This is the output stream to the socket connection.
 
Constructor Summary
SocketConnectionHTTP(java.net.InetAddress address, int port, SPCcommsHTTP m)
          Constructor is used when a connection needs to be created through a certain port.
SocketConnectionHTTP(java.net.Socket s, SPCcommsHTTP m)
          Constructor is used when a SocketServer recieves a connection and passes the socket to this class.
 
Method Summary
 boolean closeConnection()
          This method closes the connection and kills the thread that listens to incoming messages.
 void incoming(java.lang.String mess)
          Passes incoming messages from listener to the main driver.
 void write(java.lang.String data)
          Writes HTTP formatted messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpMain

SPCcommsHTTP httpMain
This is the main HTTP driver class that this connection is associated to.


client

java.net.Socket client
This is the socket connection.


out

java.io.OutputStream out
This is the output stream to the socket connection.

Constructor Detail

SocketConnectionHTTP

public SocketConnectionHTTP(java.net.Socket s,
                            SPCcommsHTTP m)
                     throws java.io.IOException
Constructor is used when a SocketServer recieves a connection and passes the socket to this class.

Throws:
java.io.IOException
Parameters:
s - Socket - connection recieved.
m - SPCcommsHTTP - TCP comms driver class that this connection associated to.

SocketConnectionHTTP

public SocketConnectionHTTP(java.net.InetAddress address,
                            int port,
                            SPCcommsHTTP m)
                     throws java.io.IOException
Constructor is used when a connection needs to be created through a certain port.

Throws:
java.io.IOException
Parameters:
address - InetAddress - address of the connection.
port - int - port number that the connection is created.
m - SPCcommsHTTP - TCP comms driver class that this connection associated to.
Method Detail

incoming

public void incoming(java.lang.String mess)
Passes incoming messages from listener to the main driver.

Parameters:
mess - byte[] - incoming message to be processed

write

public void write(java.lang.String data)
           throws java.io.IOException
Writes HTTP formatted messages.

Throws:
java.io.IOException
Parameters:
data - String - messages to be written.

closeConnection

public boolean closeConnection()
This method closes the connection and kills the thread that listens to incoming messages.

Throws:
java.io.IOException

SecurePlayLibray J2SE
v2.1

2006 Copyright Filed by IT GlobalSecure, Inc. All Rights Reserved. Not to be used without authorization by Author. SecurePlay, IT GlobalSecure, and IT Armor are registered trademarks by IT GlobalSecure, Inc. Software protected by software license, and one or more the following U.S. and International patent numbers: U.S. Patent 6,030,288, U.S. Patent 6,165,072, European Patent Office EP1016049A1,and World Intellectual Property Organization WO9912135C1 and additional filings worldwide.