Problem in Multi line string (via Socket)

Shani shani.runrev at gmail.com
Mon Apr 26 10:47:51 EDT 2010


when I use multi line string to (connect java through Socket), it write
first line to java but not write second and other lines.
When I comment first line then java read second line and display the result
against that one.

How can I use multi line string (via socket )

open socket mSocket
write "1 line "  & return to socket mSocket  -- this write on java Server
read from socket mSocket until return
    put it into kResult
write "2 line "  & return to socket tSocket   -- this not write to java
server
read from socket mSocket until return
    put it into lResult
........
........  -- when I comment first write then java read the other line form
rev

JAVA Server side coding:
___________________________

clientSocket = serverSocket.accept();
bufferedReader = new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));
bufferedWriter = new BufferedWriter(new
OutputStreamWriter(clientSocket.getOutputStream()));
if (message.equalsIgnoreCase("line1")){

do this
                                            System.out.println("line 1
executed");
                                            bufferedWriter.write(Reply); //
private static String Reply = "line1result";
                                            bufferedWriter.flush();
                                        }
                                       
                                        else if
(message.equalsIgnoreCase("Line2")){

                                            do this
                                            System.out.println("line2
executed"); 

                                            bufferedWriter.write(Reply2); //
private static String Reply2 = "line2result";
                                            bufferedWriter.flush();
}
                                        else{
                                           
                                            bufferedWriter.write("No Answer
found);                                           bufferedWriter.flush();
                                        }

-----Original Message-----
From: Shani [mailto:shani.runrev at gmail.com] 
Sent: Monday, April 26, 2010 4:05 PM
To: 'How to use Revolution'
Subject: RE: Problem in Multi line string (via Socket)

tSocket is a local variable.


-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Mark Wieder
Sent: Monday, April 26, 2010 5:22 AM
To: How to use Revolution
Subject: Re: Problem in Multi line string (via Socket)

Shani-

Sunday, April 25, 2010, 7:09:39 PM, you wrote:

> write "2 line "  & return to socket tSocket   -- this not write to java

tSocket?

-- 
-Mark Wieder
 mwieder at ahsoftware.net

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list