Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
java-client:
Java
String sentence;
try
{
    soc = new Socket("192.168.1.13",8000);             
    JOptionPane.showMessageDialog(null,"connected to server"); 
    for(int i=0;i<89;i++)
    {
        dis=new DataInputStream(soc.getInputStream()); 
        sentence=dis.readUTF();
        txt_recmsg.removeAll();
        txt_recmsg.setText(sentence);
        i--;
    }
}

c#-server:
C#
try
{
    Object objData = LCDlabel.Text;
    byte[] byData = System.Text.Encoding.ASCII.GetBytes(objData.ToString());
    for (int i = 0; i < m_clientCount; i++)
    {
        if (m_workerSocket[i] != null)
        {
            if (m_workerSocket[i].Connected)
            {                                 
                m_workerSocket[i].Send(byData);                               
            }
        }
    }
}
catch (System.Exception)
{

}
Posted
Updated 27-Jun-13 22:18pm
v2
Comments
Richard MacCutchan 28-Jun-13 4:20am    
Try using your debugger to find out what is happening, it's not possible for anyone here to guess.

1 solution

i++ and i-- in the same loop in your Java Client code...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900