Meu problema ~e esse que tá grifado… 
quando eu ainda tava usando sõ a interface meu problema era conseguir setar o TOS, agora, que tento utilizar de herança, meu problema eh o construtor(acredito eu) do Socket…tow me matando aqui pra ver se eu posso conseguir implementar o construtor da classe Socket na minha classe SocketClientTCP, se posso fazê-lo do zero…mas não encontro nenhum exemplo…vou tentar o que vc me indicou, mas se souber mais alguma coisa, sou toda ouvidos…Valeuzão!!! :-o
A seguir, código com a interface SoketOptions…
package Socket;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import <a href="http://java.net">java.net</a>.*;
public class socketClient implements SocketOptions{
private String ipServidor = “192.168.178.145”;
private int porta = 8080;
public Socket cliente=null;
private int tamBufferEnvio= 5;
private int tamBufferRecebimento=5;
private boolean estado=true;
private int tempo =50;
/**
* @param args
*/
public static void main(String[] args) {
socketClient client = new socketClient();
try {
client.gerarConexao();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
/*
if (cliente != null){
DataInputStream fluxoEntrada = new DataInputStream(cliente.getInputStream());
DataOutputStream fluxoSaida = new DataOutputStream(cliente.getOutputStream());
fluxoSaida.writeUTF("Hello!!");
fluxoEntrada.readUTF();
if (fluxoEntrada.readUTF() != null)
System.out.println("conexao bem sucedida");
fluxoEntrada.close();
fluxoSaida.close();
}
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
*/
}
public void gerarConexao( ) throws IOException{
cliente =estabeleceSocket(ipServidor, porta);
if(cliente != null){
defineTamanhoBuffers(cliente, tamBufferEnvio, tamBufferRecebimento);
definirEsperaFechamentoConexao(cliente, estado, tempo);
[b][u]cliente.setOption(IP_TOS, new Integer(1));[/u][/b]
cliente.setTrafficClass(tc);
DataInputStream fluxoEntrada = new DataInputStream(cliente.getInputStream());
DataOutputStream fluxoSaida = new DataOutputStream(cliente.getOutputStream());
fluxoSaida.writeUTF("Hello!!");
fluxoEntrada.readUTF();
if (fluxoEntrada.readUTF() != null)
System.out.println("conexao bem sucedida");
fluxoEntrada.close();
fluxoSaida.close();
}else{
System.out.println("");
}
}
public Socket estabeleceSocket(String ipServidor, int porta){
Socket cliente=null;
try {
cliente = new Socket(ipServidor, porta);
System.out.println("Conexao efetuada!");
return cliente;
} catch (UnknownHostException e) {
System.out.println("erro durante criacão do socket: "+ e);
e.printStackTrace();
return cliente;
} catch (IOException e) {
System.out.println("erro durante criacão do socket: "+ e);
e.printStackTrace();
return cliente;
}
}
public void defineTamanhoBuffers(Socket cliente,int tamBufferEnvio, int tamBufferRecebimento){
try {
cliente.setSendBufferSize(tamBufferEnvio);
cliente.setReceiveBufferSize(tamBufferRecebimento);
} catch (SocketException e) {
System.out.println("Não foi possível estabelecer tamanhos de buffer: "+ tamBufferEnvio+""+tamBufferRecebimento);
e.printStackTrace();
}
}
public void definirEsperaFechamentoConexao(Socket cliente,boolean estado, int tempo){
try {
cliente.setSoLinger( estado,tempo );//parametros: se so_linger será habilitado ou não e por quanto tempo, se o for...
} catch (SocketException e) {
System.out.println("Não foi possível atribuir valor "+tempo+ "como tempo de fechamento para a conexão");
e.printStackTrace();
}
}
@Override
public Object getOption(int optID) throws SocketException {
// TODO Auto-generated method stub
return null;
}
@Override
public void setOption(int optID, Object value) throws SocketException {
// TODO Auto-generated method stub
}
}
BJOS