Click here to Skip to main content
15,891,033 members
Home / Discussions / Java
   

Java

 
GeneralRe: tools.jar Pin
Stephen Lintott3-Nov-09 22:56
Stephen Lintott3-Nov-09 22:56 
QuestionTroubles in launching a java application at MS windows system startup (user login) [modified] Pin
Fire-Dragon-DoL2-Nov-09 15:12
Fire-Dragon-DoL2-Nov-09 15:12 
AnswerRe: Troubles in launching a java application at MS windows system startup (user login) Pin
Nagy Vilmos2-Nov-09 22:08
professionalNagy Vilmos2-Nov-09 22:08 
AnswerRe: Troubles in launching a java application at MS windows system startup (user login) Pin
42774802-Nov-09 22:44
42774802-Nov-09 22:44 
GeneralRe: Troubles in launching a java application at MS windows system startup (user login) Pin
Nagy Vilmos2-Nov-09 22:51
professionalNagy Vilmos2-Nov-09 22:51 
GeneralRe: Troubles in launching a java application at MS windows system startup (user login) Pin
42774802-Nov-09 23:07
42774802-Nov-09 23:07 
GeneralRe: Troubles in launching a java application at MS windows system startup (user login) Pin
Fire-Dragon-DoL3-Nov-09 0:38
Fire-Dragon-DoL3-Nov-09 0:38 
Questionjava server socket connection Pin
sugarandcream2-Nov-09 12:57
sugarandcream2-Nov-09 12:57 
I create a socket connection that listens for commands that sends from the client. I try to printout the command while it is reading it. ... However, I can only see the printout after I stop the client sending commands. The socket will receive a long commands that each small command is seprated by '/r'.

my client code is writen in C++, which uses a socket connection to send command to a system...

since the system is not ready to test yet, I wrote a java server socket to see if the command that sends from the C++ code is correct also want to check to see if the C++ can receives any response from the server socket ....

it's stuck as the point of the read method

public class SocketSim
{
	public static final int PORT = 2000;
 
	public static void main(String[] args)
		throws IOException
	{
		ServerSocket ss = new ServerSocket(PORT);
		Socket accept = ss.accept();
 
		System.out.println("Server socket opened and ready on " + PORT);
		
		for (;;)
			try
			{
				accept = ss.accept();
 
				processRequest(accept);
 
			}
			catch (Exception e)
			{
				System.err.println(e);
			}
			finally
			{
				if (null != accept) try { accept.close(); } catch (Exception e) { System.err.println("Failed socket close()"); }
			}
	}
	
	static void processRequest(Socket s) throws IOException
	{
		InputStream is = s.getInputStream();
		String req="";
		
		int i = 0;
		while (i != -1)
		{
			int j = is.read();
			char c = (char) j;
			
			if (j != -1)
				req += c;
			
			if (c == '\r')
			{
				System.out.println("each request: " + req);
				req = "";
			}				
		} /* while */
	}

AnswerRe: java server socket connection Pin
42774802-Nov-09 22:45
42774802-Nov-09 22:45 
Question[Message Deleted] Pin
golisarmi2-Nov-09 7:21
golisarmi2-Nov-09 7:21 
AnswerRe: online auction using java client server socket?? Pin
42774802-Nov-09 7:37
42774802-Nov-09 7:37 
GeneralRe: online auction using java client server socket?? Pin
golisarmi2-Nov-09 7:53
golisarmi2-Nov-09 7:53 
GeneralRe: online auction using java client server socket?? Pin
42774802-Nov-09 7:58
42774802-Nov-09 7:58 
GeneralRe: online auction using java client server socket?? Pin
golisarmi2-Nov-09 8:09
golisarmi2-Nov-09 8:09 
GeneralRe: online auction using java client server socket?? Pin
golisarmi3-Nov-09 12:27
golisarmi3-Nov-09 12:27 
GeneralRe: online auction using java client server socket?? Pin
Richard MacCutchan3-Nov-09 23:25
mveRichard MacCutchan3-Nov-09 23:25 
GeneralRe: online auction using java client server socket?? Pin
Nagy Vilmos4-Nov-09 0:24
professionalNagy Vilmos4-Nov-09 0:24 
GeneralRe: online auction using java client server socket?? Pin
golisarmi4-Nov-09 0:29
golisarmi4-Nov-09 0:29 
GeneralRe: online auction using java client server socket?? Pin
Richard MacCutchan4-Nov-09 2:56
mveRichard MacCutchan4-Nov-09 2:56 
GeneralRe: online auction using java client server socket?? Pin
mica131419-Jul-10 17:35
mica131419-Jul-10 17:35 
GeneralRe: online auction using java client server socket?? Pin
Richard MacCutchan19-Jul-10 22:06
mveRichard MacCutchan19-Jul-10 22:06 
QuestionC++ to MySQL Pin
santhosh-padamatinti2-Nov-09 7:18
santhosh-padamatinti2-Nov-09 7:18 
AnswerRe: C++ to MySQL Pin
42774802-Nov-09 7:33
42774802-Nov-09 7:33 
Questionapplication reinstaller Pin
aviparida2-Nov-09 6:36
aviparida2-Nov-09 6:36 
AnswerRe: application reinstaller Pin
Richard MacCutchan2-Nov-09 6:57
mveRichard MacCutchan2-Nov-09 6:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.