急啊!!socket 的问题
那位高手可以帮我看一下我的code什么问题,为什么在count==2的时候客户端就会死机?谢谢
package slics;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2007
* Company:
* @author
* @version 1.0
*/
import java.net.*;
import java.io.*;
import java.math.*;
public class Calcuserver {
public static void main(String args[]){
int count;
// Set up name database, normally this would be done in a much
// more sophisticated way using a relational database
System.out.println( "Starting the Slics server... ");
try
{ System.out.println( "creating server socket ");
ServerSocket ss = new ServerSocket(1024);
System.out.println( "finish creating ");
count=1;
// Set up the streams which the clients will access
while(true)
{
System.out.println( "1 ");
Socket sock =ss.accept();
System.out.println( "2 ");
InputStream is = sock.getInputStream();
System.out.println( "3 ");
BufferedReader bf = new BufferedReader(new InputStreamReader(is));
System.out.println( "4 ");
OutputStream os = sock.getOutputStream();
System.out.println( "5 ");
PrintWriter pw = new PrintWriter(os, true);
String a= " ";
String b= " ";