Gente, tengo una aplicacion cliente que escucha del server mediante un
socket :) pero este no deja de CRECER en BYTES hasta que hace BOOM!!
Les paso el codigo del Cliente a ver si alguien me peude dar una mano!
Desde ya gracias
César
public bool ConectarSockets()
{
bool pudoConectar = false;
try
{
xSocket = new ClienteSockete(ipServer, portServer, this);
if (xSocket.EstaConectado())
{
xTSockect = new Thread(new ThreadStart(xSocket.Escuchar));
xTSockect.Start();
this.miIP = xSocket.m_clientSocket.LocalEndPoint.ToString();
}
pudoConectar = xSocket.EstaConectado();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message );
}
return pudoConectar;
}
//aca pongo el Escuchar
public class SocketPacket
{
public Socket thisSocket;
public byte[] dataBuffer = new byte[200];
}
public void Escuchar()
{
SocketPacket theSocPkt = new SocketPacket();
if (m_clientSocket.Connected)
{
try
{
if (m_pfnCallBack == null)
m_pfnCallBack = new AsyncCallback(formu.OnDataReceived);
theSocPkt.thisSocket = m_clientSocket;
m_result = m_clientSocket.BeginReceive(theSocPkt.dataBuffer,
0, theSocPkt.dataBuffer.Length,
SocketFlags.None,
m_pfnCallBack,
theSocPkt);
}
catch (SocketException se)
{
throw new Exception(se.Message);
}
}
}
}
Leer las respuestas