madkit.communicator
Class TwoChannelsSocketExtremity

java.lang.Object
  extended by java.lang.Thread
      extended by madkit.communicator.TwoChannelsSocketExtremity
All Implemented Interfaces:
java.lang.Runnable

public class TwoChannelsSocketExtremity
extends java.lang.Thread

Thomas Cahuzac. Une instance de cette classe par Kernel distant


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 java.io.DataInputStream in
           
protected  short maxDataSize
           
protected  short messageNumber
           
 java.io.DataOutputStream out
           
 java.net.Socket socket
           
protected  java.util.Hashtable tableClient
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TwoChannelsSocketExtremity(java.net.DatagramSocket dSocket, java.net.Socket socket, TransportLayer pere, java.util.Hashtable tableClient)
           
 
Method Summary
protected  void closeSocket()
           
 java.lang.Object decode(byte[] rawobj)
          Telecharge les objets mobiles arrivant sur le port.
 byte[] encode(java.lang.Object o, java.io.ByteArrayOutputStream byteout)
           
 void run()
           
 void sendWithTCP(java.lang.Object object)
           
 void sendWithUDP(java.lang.Object o)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

messageNumber

protected short messageNumber

maxDataSize

protected short maxDataSize

socket

public java.net.Socket socket

in

public java.io.DataInputStream in

out

public java.io.DataOutputStream out

tableClient

protected java.util.Hashtable tableClient
Constructor Detail

TwoChannelsSocketExtremity

public TwoChannelsSocketExtremity(java.net.DatagramSocket dSocket,
                                  java.net.Socket socket,
                                  TransportLayer pere,
                                  java.util.Hashtable tableClient)
Method Detail

closeSocket

protected void closeSocket()

decode

public java.lang.Object decode(byte[] rawobj)
                        throws java.io.IOException
Telecharge les objets mobiles arrivant sur le port. Le protocole est:

Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

encode

public byte[] encode(java.lang.Object o,
                     java.io.ByteArrayOutputStream byteout)
              throws java.io.IOException
Throws:
java.io.IOException

sendWithTCP

public void sendWithTCP(java.lang.Object object)

sendWithUDP

public void sendWithUDP(java.lang.Object o)


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.