doubt about socket programing



my client side programme

import java.net.*;
import java.io.*;

class vissock1
{
public static void main(String args[]) throws IOException
{
Socket s=new Socket("172.18.19.203",80);
InputStream in=s.getInputStream();
OutputStream out=s.getOutputStream();
DataInputStream d=new DataInputStream(System.in);
int j;
for(int i=0;i<3;i++)
{
try
{
int k=Integer.parseInt(d.readLine());
out.write(k);
}
catch(Exception e)
{
System.out.println("enter valid no");
}
while((j=in.read())!=-1)
{
System.out.print((char) j);
}

}

}
}

my server side programme

import java.net.*;
import java.io.*;

class ser
{
public static void main(String args[]) throws IOException
{
ServerSocket s1=new ServerSocket(80);
Socket s=s1.accept();
InputStream in1=s.getInputStream();
OutputStream out1=s.getOutputStream();
while(1==1)
{
int j=in1.read();
if(j%2==0)
{
out1.write("even\n".getBytes());
}
else
{
out1.write("odd\n".getBytes());
}
}
}
}


i am able to get only one input from keyboard and accordingly the
response from server for that input.and then program is hanging
up...when i remove the code for reading server response from the for
loop(in client code) and keep out side the for loop i am getting
output.what is the reason.please help me.

.



Relevant Pages

  • SSPI Kerberos for delegation
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.win32.programmer.kernel)
  • SSPI delegation using kerberos
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.platformsdk.security)
  • SSPI Kerberos for delegation
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.platformsdk.security)
  • SSPI Kerberos for delegation
    ... security context created in server to connect back and authenticate to ... DWORD bufsiz = sizeof buf; ... int n = ib.cbBuffer; ... // wserr() displays winsock errors and aborts. ...
    (microsoft.public.security)
  • [2.6 patch] remove smbfs
    ... smbfs back in 2005 due to smbfs being unmaintained. ... for mounting to older SMB servers such as OS/2. ... -that turns any Unix host into a file server for DOS or Windows clients. ... -static int do_smb_getmountuid ...
    (Linux-Kernel)