Class ServerNetCommunication

java.lang.Object
  extended by ServerNetCommunication

public class ServerNetCommunication
extends java.lang.Object

Class ServerNetCommunication sends and receives messages to/from the server via the internet


Constructor Summary
ServerNetCommunication(ShowMessagesAble p_mess, java.util.ResourceBundle p_i18n)
           
 
Method Summary
 int connect(java.lang.String server_name, int server_port)
          It creates a connection with the server - a socket and two streams
 void disconnect()
           
 int getError()
           
 java.lang.String getErrorMessage()
           
 boolean isConnected()
           
 int receive(byte[] buffer, byte EOM)
           
 void send(byte[] buffer, int delka)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerNetCommunication

public ServerNetCommunication(ShowMessagesAble p_mess,
                              java.util.ResourceBundle p_i18n)
Method Detail

connect

public int connect(java.lang.String server_name,
                   int server_port)
It creates a connection with the server - a socket and two streams


disconnect

public void disconnect()

isConnected

public boolean isConnected()

getError

public int getError()

getErrorMessage

public java.lang.String getErrorMessage()

send

public void send(byte[] buffer,
                 int delka)
          throws ServerNetCommunicationException
Throws:
ServerNetCommunicationException

receive

public int receive(byte[] buffer,
                   byte EOM)
            throws ServerNetCommunicationException
Throws:
ServerNetCommunicationException