Getting number of bytes sent/received with SSLSocket

Is there any way I can get the number of bytes sent/received with an SSLSocket, but after the handshake/encryption process ?

Hello,
Yes there is a way, while your reading your file:
import java.util.zip.*; //need to import this class
     static int k = 0;
     static InputStream inStream = null;
     static OutputStream outStream = null;
     static BufferedReader br = null;
     Adler32 adler32 = new Adler32();
          byte[] buffer = new byte[1024];
               while ( ( k = inStream.read(buffer))!= -1)
                    adler32.update(buffer, 0, k);
                    outStream.write(buffer, 0, k);
System.out.print(Long.toString(adler32.getValue() );
I hope it helps

Similar Messages

  • Bytes sent/received

    Hello!
    I'm trying to develop an application in java that has the ability to measure total bytes or packets sent and received on my local computer from the internet-connection or Local Area Connection in win 2000.
    I want to display a grapher that shows percentage of the bandwith used updated once every second or 5 seconds, and display the amount of data that is sent/received while the app is running or the win 2000 system running.
    I'm trying to avoid using JINI (via C/C++ or similar). I have made a simple poller app. that uses the windows cmd tool -net statistics workstation. This was just for a simple test, and I can't really use it. I need the similar kinds of data.
    Is there a way to collect statistics from the ethernet card or LAN connection to be measured? Is there a native interface like that?
    Possible to "listen" to the internet/network-connections locally?

    This question has been asked over and over again.
    In Java, you can't access the raw socket (well, in 1.4.2 you are supposed to be able to). Thus, you can't get access to the bandwidth and total "packet" length.
    1. However, you can define a test for the bandwidth, and test at the other end (based on data/time) and have that number sent back to the app.
    2. You can use data streams and count the buffer flow to see how much was sent and recieved. Attaching the I/O streams from the sockets to an external process (program, application, etc) then you can esaily monitor and graph while the app is using the connection.
    I would love to be able to get that low-level connection to sockets. There are however, non-Java, native function libraries that can do this outside of Java and then have your JNI-compliant Java app use that code. In fact, most of what you want is avaiable via the Registry - and yes, there are JNI libs out there that do just that - create an interface between Java applications and the Windows Registry.

  • Feature request: get bytes sent and received

    Is there a way to get the number of bytes sent a received? For other stats, I use code such as:
    com.tangosol.coherence.component.net.Cluster cluster = (com.tangosol.coherence.component.net.Cluster)
                        ((SafeCluster)com.tangosol.net.CacheFactory.ensureCluster()).getCluster();
    PacketPublisher publisher = cluster.getPublisher();
    PacketReceiver receiver = cluster.getReceiver();So, I'm looking for a way to get bytes transferred info out of the publisher and receiver objects.
    Thanks,
    Matt

    Matt,
    First, I'd like to underscore the fact that all this is not a public API yet and may change without notice.
    Currently, you can get the number of sent and recieved packets:
    publisher.getStatsSent();
    receiver.getStatsReceived();To transalte this into bytes you'd have to factor it by the value of "cluster-config/packet-publisher/packet-size/preferred-length" element in "tangosol-coherence.xml" descriptor.
    Gene

  • How much is the maximum number of byte that a string control can hold?

    And also if the the number of byte sent to a string control is beyond that limit, will the string control discard that data?

    From App Note 154:
    "LabVIEW stores strings as a pointer to a structure containing a 4-byte length value followed by a 1D arrays of byte integers (8-bit characters)."
    The 4-byte value is the same size as a U32, which has a range of 0 to 4,294,967,295. So, your string can have up to 4,294,967,295 characters. If you have the memory
    What does a control do if you exceed that? I don't know. I don't have enough RAM to try it and see.

  • My apple id account is setup with my dads cell phone number, so on my iMessages on my mac i get my dads texts messages, is there anyway to change it so my phone number is the one receiving messages on my mac?

    My apple id account is setup with my dads cell phone number, so on my iMessages on my mac i get my dads texts messages, is there anyway to change it so my phone number is the one receiving messages on my mac?

    Remove his phone number from your AppleID.
    http://appleid.apple.com

  • I am trying to install premier elements 11 that I purchased back in 2012 on a new machine with 8.1. I get "invalid serial number" when I enter the serial number I received with the original activation e-mail when I purchased the product, thanks!

    I am trying to install premier elements 11 that I purchased back in 2012 on a new machine with 8.1. I get "invalid serial number" when I enter the serial number I received with the original activation e-mail when I purchased the product, thanks!

    Error "The serial number is not valid for this product" | Creative Suite

  • TS4268 My text messages are being sent and received with my email address instead of my phone number. How do I fix this?

    My text messages are being sent and received with my email address instead of my phone number. How do I fix this?

    This is with iMessages only.
    Go to Settings > Messages > Send & Receive and below the Start New Conversations From, select your cell phone number instead of your Apple ID email address.

  • Reviewing my bill i saw a LOT of text messages from a odd number sent to my number, BUT i never received them. Why would this be??

    Reviewing my bill i saw a LOT of text messages from a odd number sent to my number, BUT i never received them. Why would this be??

    Why did you give your granddaughter the password?
    FOR ASSISTANCE WITH ORDERS - iTUNES STORE CUSTOMER SERVICE
    For assistance with billing questions or other order inquiries, please refer to our online support page by clicking here: http://www.apple.com/support/itunes/store/. If you cannot find the answers you are seeking in our robust knowledge base, you can contact us by visiting the following URL http://www.apple.com/support/itunes/store/, clicking on the appropriate Customer Service topic, then using the contact button or email form at the bottom of the page. Responses to emails will be provided as soon as possible.
    Phone: 800-275-2273 How to reach a live person: Press 0 four times
    Hours of Operation: Mon-Fri: 9am-5pm ET
    Email: [email protected]
    How to report an issue with Your iTunes Store purchase
    http://support.apple.com/kb/HT1933
    iTunes Purchase Problems: How to Report a Problem to iTunes Support
    http://tinyurl.com/7tscpa7
    How to Get a Refund from the App Store
    http://gizmodo.com/5886683/how-to-get-a-refund-from-the-app-store
    Canceling a Digital Subscription
    http://gadgetwise.blogs.nytimes.com/2011/10/14/qa-canceling-a-digital-subscripti on/
     Cheers, Tom

  • I recently purchased an Onkyo stereo receiver with a wireless USB adapter, UWF-1, and want to stream audio from my MacBook Pro through my stereo system. The receiver tells me it is connected to my wireless LAN, but I cannot get music to play?

    New to the community here, thanks for your patience.  I recently purchased an Onkyo TX-8050 Network Stereo Receiver with the UWF-1 USB adapter with the intent to stream audio from my MacBook Pro to the stereo. I have gone through the setup instructions for the adapter and the receiver gives me a message saying that it is connected to the password protected network, but that is as far as I can get.
    I have gone into iTunes and clicked on the "Open Stream" option, but I just get a pop up box labeled "URL" that is empty. I have Home Sharing turned on and File Sharing turned on, but I am not seeing the receiver in my Finder window or as a iTunes device.
    I would appreciate any and all advice and assistance.
    Thanks so much.
    Dan

    So I have been searching the iStore for Airplay and I find lots of information about what it is, but nothing about how much it costs, how/where to buy it, etc.?
    Fortunately, AirPlay does not cost anything as it is a streaming protocol used by Apple. Currently, the AirPort Express and Apple TV are AirPlay-ready. A number of other companies, like JBL, iHome, Denon and Klipsch are also rumored to be working on AirPlay versions of their products.
    Your other option would be to get an AirPort Express and connect it to your Onkyo analog or optical digital audio input and stream from iTunes that way. I currently do this with my 10+ year old Harmon Kardon HT receiver.

  • When I pre ordered my iphone 6 i was told I was going to get an additional 1 gig of data per month for a year.  It even shows it on the receipt i received with the phone.  When will I see that reflected on my account.  I have had my new phone for a week a

    When I pre ordered my iphone 6 i was told I was going to get an additional 1 gig of data per month for a year.  It even shows it on the receipt i received with the phone.  When will I see that reflected on my account.  I have had my new phone for a week and used tons more data than usual and am hoping that will save me this month.

    concretedonkey, I'm glad you were able to take advantage of this offer when you ordered your new iPhone 6. I can certainly review your account to ensure this was added for you. Please reply to the direct message I have sent you.
    AndreaS_VZW
    Follow us on Twitter @VZWSupport

  • How to get the number of bytes stored in a field?

    Hi Guys,
    How can i get the number of bytes stored in a field.
    I tried using DESCRIBE FIELD, But here i am getting the length from the definition.
    i.e 8 bytes for string and for character value is from definition.
    Prompt replies will be Awarded with full points:-)
    Thanks,
    vinod.

    u see this : http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f2e5446011d189700000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21f2e5446011d189700000e8322d00/frameset.htm
    Madhavi

  • How to calculate the number of sent/received emails of a certain domain

    Thank you for what you have helped me with!
    How to calculate the number of sent/received emails of a certain domain in a certain period? It is Messaging Server 5.2, Directory Server 4.2. Is there a log option for this?
    Thank you.

    Not sure where you find, "LOG_MESSSAGE_ADD". I don't actually find this option in the documentation.
    The domains that mails are coming from and being sent to are certainly logged in the normal mail.log, so why mess with additional logging options? If you're talking about "LOG_CONNECTION", I actually see no additional data that is useful to you.
    If you decide to change the option.dat, you do indeed need to
    imsimta cnbuild (note, it's not cnrebuild)
    imsimta restart
    If I were facing the same issue, I'd be looking at the log parsing perl script, and simply modifying it to do what I wanted.

  • Can't send but can receive text with certain number but can send/receive to others

    After a year of texting with an out of network (T mobile) number, yesterday my phone became unable to send text to it.  It receives no problem, sends and receives to other numbers and the t mobile number is sending and receiving other numbers without issue.  I get an error message with the X envelope icon.  I've rebooted and had the old conversation deleted from the t mobile number.  I have no idea how to troubleshoot further

    Success!  I tried *228 but no improvement.  Took the phone to Verizon and they blamed Facebook, which I think is close to the truth.  Verizon doesn't support texting to 11 digit phone numbers, so if your contacts are synched to something that uses that format, it might change the way the phone sees the contacts phone number when it tries to SMS the contact.  Lose the leading 1 and you should be OK.

  • How to get the number of bytes at ethernt port using tcp/ip?

    I have data with variable sizes.I am getting the data from another sytem using software C.
    How can I get the exact number of bytes coming at the port before using the read command so that the no. of bytes at port has to be given as the input to the tcp read vi?

    Philippe_RSA wrote:
    So may responses saying your question is wrong..... typical of this site, and no decent answer after 5 years !
    The answer I have used is to use a call library function:
    short int ioctlsocket(unsigned long socket, unsigned long fionread, unsigned long *len);    
    where fionread is a windows defined constant =  4004667F
    The socket can be obtained from using the       TCP Get RAW NET OBJECT.vi   which comes with Labview (even as far back as version 7).
    Good luck.
    A protocol requiring such a hack is IMHO very poorly designed. You should always have some way on the wire to determine the data stream size. If the data is fixed size that would be inherent to the protocol, if it's variable sized there should be a fixed size header or a known message termination indication that can be used to determine how to read the rest of the message.
    As a side node, I do consider the existence of VISA Bytes at Serial Port a big error, and that is most likely where this question originally came from. Use of "bytes at port" to decode a protocol will ALWAYS lead to protocol errors sooner or later, and code that is unneccessarily complicated to force the routine to deal with the asynchonous reading of the "bytes at port" into the protocol decoding.
    If a protocol can't be decoded with fixed size reads, fixed size reads with following variable size reads determined from information in the header, or a specific message termination indication, then it is very badly flawed.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Regarding iMessage, when i want to send text to a person in my contacts app, i've been getting a message saying the number has not been registered with iMessage.  How can one fix this problem?

    Regarding iMessage, when i want to send text to a person in my contacts app, i've been getting a message saying the number has not been registered with iMessage.  How can one fix this problem?  It works on the iPhone.

    It takes two to tango, maybe it's your recipient that has weak Internet/Cellular connections.

Maybe you are looking for