Topic: TCP/IP Message gets Appended with two dots...(Urgent)
Dear All,
I am working on a requirement where I am sendind a message
(underlying protocol used TCP/IP) using a program
developed using Java Sockets.
It sends the messgage on desired mechine and port but two dots(..)
gets appended with this message .
I am really not able to figure out from where these dots are coming ,
is it the network that appends these dots.
Any clue will be helpful.
An early response is highly appriciable.
Thanks and Regards
Dushyant Bhardwaj
You should use a BufferedWriter instead of a PrintWriter, since you're using a BufferedReader. these streams tend to work best in pairs. The readLine requires a newline, so
import java.io.*;
import java.net.*;
public class TestSW
public static void main(String[]args)
BufferedWriter output;
BufferedReader networkBin;
Socket socket=null;
try{
socket = new Socket("127.0.0.1",5050); // connect to echo server
output = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
networkBin = new BufferedReader(new InputStreamReader(socket.getInputStream()));
output.write("testing");
output.newLine();
output.flush();
System.out.println(networkBin.readLine());
}catch(IOException e){
e.printStackTrace();
}finally{
if(socket != null){
try{socket.close();}catch(IOException ce){}
}
Similar Messages
-
Letter e with two dots above it
I am trying to write the correct spelling of Citroen, how do I get the letter e with the 2 dots above it.
type "alt+u", then "e".... gives ë ! or... Citroën even!
(BTW: "two dots" are called an "umlaut".) -
Received a mail message on my iPhone and next toit there is a red circle with a blue dot inside it. Normal messages have a solid blue dot when unread. What does the red circle with blue dot mean?
LMS111 wrote:
I would agree with Barney if the question had been an e-mail in the inbox but in the sent folder I still wonder why the blue dot. I also had this happen for the first time today 6/27/13. I resent both figuring it might mean the mail had not been sent properly.
No, it means unread, had you opened the mail in the sent folder the blue dot would have gone away. -
Tried updating my iPhone 4S with IOS 7. It is now frozen on a white screen with two black dots and two black dashes. It will flip to another screen once in a while that says "Slide to setup." But when I do, it goes back to the screen with the dots and dashes.
What happened with your phone? I'm experiencing the same problems at the moment.
-
TCP XML messages parsing time with realtime output.
I am currently coding a project and I have hit a bit of a roadblock. The basic overview is I need to be able to receive around 3,000 lines of XML per second from a JavaScript sending TCP messages. I have to extract the data to two seperate files, output the data to a text pane and also further seperate that data into a table as well. All this data needs to be updated as soon as it is received. I am currently comfortable with receiving around 700 lines per second without data loss but anything over that I start losing data somewhere. As for the basic over view of my code, I have my main program which creates the GUI and starts a listening thread that listens for "clients"(JavaScripts) to connect.
Main:
public static void main(String[] args)
SplashScreen screen = new SplashScreen();
screen.showSplashWindow();
SwingUtilities.invokeLater(new Runnable()
public void run()
MainMenu mainmenu = new MainMenu();
mainmenu.setVisible(true);
mainmenu.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}Listener Thread:
final Runnable listener_runner = new Runnable()
public void run()
try
startClientListener();
catch (Exception e)
final Thread listener_thread = new Thread(listener_runner,
"ListenerThread");
listener_thread.start();Called from listening thread to setup client:
public void startClientListener() throws IOException
ServerSocket serverSocket = null;
try
serverSocket = new ServerSocket(XXXX);
catch (IOException e)
System.err.println("Could not listen on port: " + portNumber);
while (true)
MultiServerThread new_thread = new MultiServerThread(serverSocket
.accept(), outputWindow, resultsWindow, prefAttr, runningCount);
new_thread.start();
}In my MultiServerThreads runnable I have a BufferedReader to read the input. This reader loops through the input and adds it to a StringBuilder which then passes that data to the output files and the XML parser as seen here:
in = new BufferedReader(new InputStreamReader(socket
.getInputStream()));
while ((input_line = in.readLine()) != null)
build.append(input_line + "\n");
file_out.append(build); //Text file
xml_copy_out.append(build); //XML file
loadData(build); //XML parser
build = new StringBuilder();
}My XML parser is configured as follows:
public void loadData(final StringBuilder bufs)
bufs.insert(0, "<VTR>");
bufs.append("</VTR>");
try
StructuredDocumentHandler par = new StructuredDocumentHandler(
runningCount);
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(false);
javax.xml.parsers.SAXParser sp = spf.newSAXParser();
final String s = bufs.toString();
final ByteArrayInputStream file_buf = new ByteArrayInputStream(s
.getBytes());
final DataInputStream in_data = new DataInputStream(file_buf);
org.xml.sax.InputSource input = new InputSource(in_data);
sp.parse(input, par);
catch (Exception ex)
ex.printStackTrace();
}As the parser goes through each XML message it sends the String to an output window that is straight text in a TextArea. It also stores the data in some arrays which then get built into a row that is added to a JTable. Does anyone have any ideas on how I can get up to 3000 lines per second? I'm not sure if my threading scheme is wrong or what. Is Java not powerful enough to handle 3000 TCP messages per second or can the XML parser not handle that much processing that fast? Any help would be much appreciated because I've kind of run out of ideas. Thanks!Thanks for the replies. I've trimmed my code down a little bit which has helped. I'm still around 2000 messages a second. Here's where I'm at for an update. Thanks again for all your help. I'm much happier at 2k vs 700 messages per second.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Calendar;
import javax.swing.JOptionPane;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.helpers.DefaultHandler;
public class MultiServerThread extends Thread
private final StructuredDocumentHandler par = new StructuredDocumentHandler();
private final SAXParserFactory spf = SAXParserFactory.newInstance();
private SAXParser sp;
public MultiServerThread(final Socket socket,
final OutputWindow output_window,
final ResultsWindow results_window,
final PreferencesDialog.Info attr, final int count)
try
spf.setValidating(false);
sp = spf.newSAXParser();
catch (Exception ex)
@Override
public void run()
try
xml_copy_out.append("<VTR>\n");
in = new BufferedReader(new InputStreamReader(socket
.getInputStream()));
while ((input_line = in.readLine()) != null)
file_out.append(input_line + StaticVariable.NEW_LINE);
xml_copy_out.append(input_line + StaticVariable.NEW_LINE);
loadData(input_line);
xml_copy_out.append("</VTR>");
xml_copy_out.close();
file_out.close();
in.close();
attributes.parent.setCheckFailed(runningCount, procPassed);
socket.close();
catch (FileNotFoundException ex)
catch (Exception e)
e.printStackTrace();
public void killOuts()
public void loadData(final String xml_str)
try
ByteArrayInputStream file_buf = new ByteArrayInputStream(xml_str.getBytes());
InputSource input = new InputSource(file_buf);
sp.parse(input, par);
catch (Exception ex)
ex.printStackTrace();
public void addRowData(boolean procedurePassed)
public void clearArrays()
public class StructuredDocumentHandler extends DefaultHandler
boolean procedurePassed = true;
boolean isTestCase = false;
boolean isTestCaseInput = false;
boolean isTestCaseOutput = false;
boolean isTestStep = false;
boolean isComment = false;
boolean isRequirement = false;
boolean isEnsure = false;
boolean isVerify = false;
boolean isResult = false;
boolean eval = false;
public StructuredDocumentHandler()
public void startElement(String uri, String lname, String qname,
Attributes attributes)
if (!qname.equals(StaticVariable.XML_COMMAND))
eval = true;
if (qname.equals(StaticVariable.XML_TESTCASE))
isTestCase = true;
else if (qname.equals(StaticVariable.XML_TESTCASEINPUT))
isTestCaseInput = true;
else if (qname.equals(StaticVariable.XML_TESTCASEOUTPUT))
isTestCaseOutput = true;
else if (qname.equals(StaticVariable.XML_TESTSTEP))
isTestStep = true;
else if (qname.equals(StaticVariable.XML_COMMENT))
isComment = true;
else if (qname.equals(StaticVariable.XML_REQUIREMENT))
isRequirement = true;
else if (qname.equals(StaticVariable.XML_MEASUREMENT))
String xml_val = attributes
.getValue(StaticVariable.XML_VALUE);
outputWindow.addData(xml_val + StaticVariable.NEW_LINE);
measurementArray.add(xml_val);
else if (qname.equals(StaticVariable.XML_EXPECTED))
String xml_val = attributes
.getValue(StaticVariable.XML_VALUE);
outputWindow.addData(xml_val + StaticVariable.NEW_LINE);
expectedArray.add(xml_val);
else if (qname.equals(StaticVariable.XML_RESULT))
isResult = true;
else if (qname.equals(StaticVariable.XML_VERIFY))
isVerify = true;
verifyArray.add(new String(attributes
.getValue(StaticVariable.XML_RESULT)));
else if (qname.equals(StaticVariable.XML_ENSURE))
isEnsure = true;
public void characters(char[] chars, int start, int length)
if (eval)
if (isTestCase)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
testCaseArray.add(new String(chars, start, length));
else if (isTestCaseInput)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
testCaseInputArray.add(new String(chars, start, length));
else if (isTestCaseOutput)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
testCaseOutputArray.add(new String(chars, start, length));
else if (isTestStep)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
testStepArray.add(new String(chars, start, length));
else if (isComment)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
commentArray.add(new String(chars, start, length));
else if (isRequirement)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
requirementArray.add(new String(chars, start, length));
else if (isResult)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
resultArray.add(new String(chars, start, length));
else if (isVerify)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
verifyDescriptionArray
.add(new String(chars, start, length));
else if (isEnsure)
outputWindow.addData(new String(chars, start, length)
+ StaticVariable.NEW_LINE);
ensureArray.add(new String(chars, start, length));
public void endElement(String uri, String lname, String qname)
if (!qname.equals(StaticVariable.XML_COMMAND))
if (qname.equals(StaticVariable.XML_VERIFY))
addRowData(procedurePassed);
clearArrays();
else if (qname.equals(StaticVariable.XML_END))
clearArrays();
isTestCase = false;
isTestCaseInput = false;
isTestCaseOutput = false;
isTestStep = false;
isComment = false;
isRequirement = false;
isResult = false;
isVerify = false;
isEnsure = false;
eval = false;
}Any other suggestions on trimming down that I'm not seeing would be much appreciated. Thanks again for all your help. -
How to get value with two parameter fro sharepoint list in SSRS reporting
Hi
I am using Sharepoint list and fetching data in SSRS.
Using three parameter as Department,Section and subsection.
with filter everything working fine,but if i use category All and Sub category all for particular department,unable to get record.
please let me know how to implement.
Help will be appreciated.
Hasan Jamal Siddiqui(MCTS,MCPD,ITIL@V3),Sharepoint and EPM Consultant,TCS
|
| TwitterHi Hasan,
Per my understanding you want to add mutilple value parameters to filter the data in the sharpoint list datasource report, right?
I have a test based on the step by step details information in below link and all works fine which will make the multiple value parameter works fine:
https://audministrator.wordpress.com/2014/02/17/sharepoint-list-add-distinct-parameter-value/
Add the custom code from above link
Parem1 is the parameter which get values from a query and with all the values(duplicate value),please setting as below:
Param2 is the parameter which will display in the report have done the deduplication, check the "Allow Multiple values" and then Specify the available value and default value using below expression:
=Split(Code.RemoveDups(JOIN(Parameters!Param1.Value, ",")), ",")
Add the filter and preview.
Similar thread below for your reference:
SSRS reporting with sharepoint list using Distinct and Multivalue
parameters
If i have some misunderstanding, please try yto provide more details information about your requirements.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
URL getting appended with the code
Hi All,
When I am trying to open a window as a pop-up in my BSP application it is appending the URL with the code I have written .
It looks as below :
http://sample.htmwindow.open('test.htm','width=100,height=200').
The above URL is opening the Test.htm page but not as pop-up.Its overridding the new page and in the URL of this page I am able to see the above URL
Can anyone tell me where I have done a mistake to open this window.
Thanks ,
Ghousia NaazHi,
Could you please provide the code you've written?
Did you try putting "javascript:" in front of your window.open code?
Best regards,
Guillaume -
Why are my messages getting sent to two different phone numbers?
My mom and I use the same Apple account for our iPhones and when we updated our phones for iOS 6, all of the text messages that I've been receiving have been sent to her iPhone as well.
Tjmoo, did you find out the answer to your question? If so, will you share? I am having an issue where some of my messages to iPhone users go through as iMessages while others go through as text messages. I am not sure why this is because the people I am sending them to have iPhones.
Thanks! -
Getting quarters with two input date-parameters
I have to find a way to get all the quarters between a startdate and an enddate, like 01-04-2009 (startdate) and 31-11-2009 (enddate). An extra condition is to count an extra quarter above the enddate, so the last quarter is 2010-01 (first quarter of 2010).
The desired result will be:
2009-02
2009-03
2009-04
2010-01
The start- and enddate are inputparameters.
How do I get this result?Hi,
You're getting a quarter for each 3 values of LEVEL.
To get one more quarter, add 3 to the limit on LEVEL:
select distinct
to_char(qdate,'YYYYQ') quarter
from ( select add_months ( to_date (:start_date, 'DD/MM/YYYY')
, m
) qdate
from ( select level m
from dual
connect by level < 3 + -- Added
ceil ( months_between ( to_date (:end_date, 'DD/MM/YYYY')
, to_date (:start_date,'DD/MM/YYYY')
order by quarter
;Edited by: Frank Kulash on Jan 22, 2010 9:09 AM
By the way, you don't need all those sub-queries.
SELECT TO_CHAR ( ADD_MONTHS ( TO_DATE (:start_date, :date_format)
, 3 * (LEVEL - 1)
, 'YYYYQ'
FROM dual
CONNECT BY LEVEL <= 1 + CEIL ( MONTHS_BETWEEN ( TO_DATE (:end_date, :date_format)
, TO_DATE (:start_date, :date_format)
/ 3
; -
How to open url with two varible(URGENT)
Hi everyone
Could you tell what wrong is in this line.
String x="http://localhost/Test.php?memberID=ww&movieID=mm";
Runtime.getRuntime().exec("cmd /c start iexplore "+x);
why does my Test.php always only get the first parameter?
Test.php only got member id is ww.
However movieID become undeclared.
Is '&' not working in java?
Thank you very one
Yang BinTry :
String x="http://localhost/Test.php?memberID=ww&movieID=mm";
Runtime.getRuntime().exec("cmd /c start iexplore \""+x +"\"");
the command should look like :
cmd /c start iexplore "http://localhost/Test.php?memberID=ww&movieID=mm" -
How to type an e with an ' over it or an o with two dots of it.
I'm putting a title in my home movie and in the "Staring" portion I have names with an e that is supposed to have an ' over it and one name with an o with I need to put to dots over it. How do I do this?
I was hitting Option e and not the ' key. It still shows up as ' in multiple programs. None have it show up with e with ' over it.
If you are pressing OPTION-e and OPTION-e then all you will end up with is an apostrophe. As stated above, press OPTION-e and e (no OPTION key for the second press). I tested this in iMovie '08 using the default font associated with the "Transparent - Black" title option (i.e., the Helvetica Neue font with default encoding for the application) and it works fine for me. -
I'm trying to sequence a package that has a file named "..a". (don't ask me why they named it this way...)
When trying to save this package, the App-V sequencer will say it has encountered an error and the package was not saved.
To reproduce, simply try creating a new package, and create a new empty file and rename it to "..a" (extension included). When you try to save the package, the error should pop up.
It looks like the leading double dot might be confusing the sequencer into somehow treating it as a file in the parent directory, because under the package editor it shows the file as having an empty name, and being outside of the AppVPackageRoot folder.It is reproduced easily - but this is the first app that I have ever heard of that does this. You could possibly open a case with Microsoft.
Steve Thomas, Senior Consultant, Microsoft
App-V/MED-V/SCVMM/Server App-V/MDOP/AppCompat
http://blogs.technet.com/gladiatormsft/
The App-V Team blog: http://blogs.technet.com/appv/
The MED-V Team Blog: http://blogs.technet.com/medv
The SCVMM Team blog: http://blogs.technet.com/scvmm/
“This posting is provided "AS IS" with no warranties, and confers no rights. User assumes all risks.” -
Messages getting stuck in QRFC Queue
Hi,
Today I noticed that a message had gotten stuck with the status "Sheduled for Outbound Processing" (scenario IDOC->XI->File), XI 3.0 SP11.
This in turn had the effect that the whole QRFC queue got stuck, and all following messages got stuck with status "Sheduled".
I had to remove the first message from the queue manually so that XI could start to purge the other messages from the queue.
What could be the reason for the first messages getting stuck with this status ("Sheduled for Outbound Processing")?
The message was very small, just a couple of lines. One thing that comes into mind, is that XI received 4 IDOCS for the same interface, within one second. These 4 messages were assigned to different queues, but one of them got stuck. Could there be problems with XI when several messages arrive on the same interface within a very short time?
Is it possible to use Alerts to detect this kind of problem in the future? As I have understood, Alerts only handle XI "errors", but according to XI, this message did not have an "error status", it just had the status "Sheduled for Outbound processing"..
Thanks for any help,
HansHi,
If the message got struck in Queue, you try to activate the queues in smq2 to reprocess the data instead of deleting it. This is the final solution. But you should able to see a dump in ST22 for this problem.
thanks,
sasi -
Problem keep getting the eye and two dots
Sound like many people are haven the same problem and no reply back from Verizon yet.
Cell phone sit there, and goes into this mod, "Eye with two dots" on the display. Lock the cell, and after some time, does a reboot.
I removed the battery, and thought cold restart, came back to the same spot, lock.
Fix from store outlet: told to reboot the software and prior to that, remove all the items..
sound like a long shot, how come no feed backf rom Verizon IT people.
JaymeHey there Jayme!
If we have many people having the same issue, I appreciate you speaking up a bit more. Let's see what's going on here. Let me clarify, while your phone is idle, it will randomly come up with a screen with an eye and 2 dots, correct? Then it will turn off and back on? If that is what's going on, a hard reset and erasing all information is probably the best step. This issue may be caused by an application or possibly something in the software. Reverting back to the way it was out of the box can determine this.
I also apologize about not getting back to you until now. This is a peer-to-peer forum and we only interject when the question isn't answered by one of our lovely community members. Please feel free to contact us on Facebook or Twitter @vzwsupport. Thanks!
MichelleG_VZW -
I have a group text with two of my friends. here's each person break down
person 1 ATT network, using imessage
person 2 verzion network, using imessage
person 3 verzion network, using SMS
All three of us are in a group chat. When person 1 sends a message, person 2 recieves it, but person 3 does not. Then when person 3 sends a message, both person 1 and 2 get it. When person 2 sends an Imessage, person 1 and 3 get it
so the problem is when person 1 sends an imessage, it doesnt change to sms and person 3 doesnt get it, but person 2's automatilly switches it to green.
How can person one get their phone to automaticlly switch it to green in group message while keeping on imessage?The quote below from http://support.apple.com/kb/HT5760 indicates that it in the situation you describe it should be going as MMS to everyone -- which is not what you are seeing actually happen (and also not what you want to happen if I understand correctly). There may be something else helpful in the link.
Group messages will be sent using iMessage if all recipients have iMessage enabled. If not, the conversation will be sent as MMS. Group messages use MMS even if the content is text only.
Maybe you are looking for
-
How to retrieve data from this XML
Hi I am getting below XML file and I need to get data from the file into table in a database ( SQL SERVER ). Please kindly help to shred and load the data into a table <claimInvoice xmlns="http://www.XYZ.com"> <INum>INum1</INum> <dueAmount xmlns
-
Flash Builder 4.7 won't debug air app on Android devices anymore
Hi there, A strange thing happened today to my Flash Builer 4.7 installation on OS 10.8.5 : it suddenly refused installing and debugging AIR apps. At -the famous- 57% of compilation completion I can see the "installing app on device" message, but not
-
if someone can let me know that would be great. i cannot find how to play the movie i rented after closing itunes. Thanks
-
Business Object : access to object attribute in method
Hi, i've created a BOR object named Z_myobject : - Attributs : . START_DATE (type SYST-DATUM) . END_DATE (type SYST-DATUM) . MANAGER (type BOR EMPLOYEET) - Methods . Check_actors In the Check_actors method i want to access to the MANAGER
-
What is this mean "Unsupprted image format" ??
Hello i've been cropping and editting and now suddenly when i click on a photo to enlarge full screen i get " unsuported image format"" thats so terrible because now i cant export them end email files.. anybody can tell me what this is thanks thanks