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.

Similar Messages

  • 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

  • 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

  • Is there a way to view pictures sent & received?

    is there a way to view pictures and messages sent & received?

    You can view the text messages and picture messages on the phone they were sent form, and on the phone that received the messages.  With the introduction of Integrated Messaging, you can now send and receive messages on phones, tablets, and your computer.
    Depending on your phone and other devices, how you would view those messages may change. What device(s) do you have?  Have you tried the Integrated messaging app?

  • 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 a third person track on messages and calls sent/received through apple id

    can a third person track on messages and calls sent/received through apple id

    You're welcome.
    If you think this is happening to you, change your Apple ID password.

  • How many bytes are received?? for experts!!

    hi,
    how can i detect/write out how many bytes are received when i use readObject() from class ObjectInputStream ...?
    i must do this for a progressbar ...
    when i write this function to receive only 1 byte, then the next, the next, ...,, it is very, very slow ... :(
    thanx !! :)
    - smat

    hi,
    now i have CountingInputStream extended to read only 11k ...
    here is the code, can you please correct it...?
    import java.io.*;
    public class CountingInputStream extends FilterInputStream {
        private int count, tmp0, tmp1;
        private byte[] buffer0 = new byte[11264], buffer1 = new byte[11264];
        public int getCount() {
            return count;
        public CountingInputStream(InputStream is) {
            super(is);
            count = 0;
        public int read(byte[] b, int off, int len) throws IOException {
            int n = 0;
            tmp1 = len;
            if(len < 11264) {
                n += super.read(b, off, len);
                if(n > 0)
                    count += n;
            } else {
                while(tmp1 > 0) {
                    tmp1 -= 11264;
                    n += super.read(buffer1);//b, off, len);
                    if(n > 0)
                        count += n;
                    int ccc = 0;
                    for(int y = off; y <= ((y+len)-1); y++) {
                        b[y] = buffer1[ccc];
                        ccc++;
                    off += n;
            return n;
        public int read(byte[] b) throws IOException {
            int n = 0, off = 0;
            tmp0 = b.length;
            if(tmp0 < 11264) {
                byte[] tmpBuffer = new byte[tmp0];
                n += super.read(tmpBuffer);
                if(n > 0)
                    count += n;
                b = tmpBuffer;
            } else {
                while(tmp0 > 0) {
                    tmp0 -= 11264;
                    n += super.read(buffer0);
                    if(n > 0)
                        count += n;
                    int ccc = 0;
                    for(int y = off; y < n; y++) {
                        b[y] = buffer1[ccc];
                        ccc++;
                    off += n;
            return n;
        public int read() throws IOException {
            int n = super.read();
            if(n >= 0)
                ++count;
            return n;
    }

  • HT1296 Any way to sync sent/received email messages on iPad with Mac computer.

    Any way to sync sent/received email messages on iPad with Mac computer?

    The easiest way is to use an IMAP mail account exclusively. Stay away from "On My Mac" mailboxes/folders and POP3 accounts.

  • How can i guarantee that comma (8'hbc) will be aligned to first byte of received data?

    i'm now using the spartan6  gtp to transmit 32 data through the fiber(with 8b/10b encoding enable),when i send the data which includes the comma  (32'h090909bc),how can i guarantee that comma (8'hbc)  will be aligned to first byte of  received data .and i just can guarantee that comma (8'hbc)  will be aligned to even byte of  received data (attribute ALIGN_COMMA_WORD is set to be 2).

    Hi,
    Please avoid posting multiple post. I have answered your query here - http://forums.xilinx.com/t5/Spartan-Family-FPGAs/how-can-i-guarantee-that-comma-8-hbc-will-be-aligned-to-first/m-p/644938/highlight/false#M32601
     

  • Sent & Received Data

    Hi there, when it says you have a data limit per month of 700mb, does this mean your sent & received data added together or just one of them? thanks guys.

    That is a question you should direct to your carrier. But on this side it is the two added together.

  • Receiving/rendering streaming bytes sent to a port

    I understand RTP is the solution (and will be implemented in the next few weeks) but for the mean time, the video producer is sending the frames (RGB) to a port. My current application listens/receives the data via a BufferedInputStream:
    try {
         stream =
              new BufferedInputStream(
                   (new Socket(host, port)).getInputStream(),
                        ( (Header.size()+ (Constant.WIN_WIDTH * Constant.WIN_HEIGHT * this.componentCount))) );
    }and creates the ByteBuffer based on known values of the data sent to the port:
    byte[] imageBytes = new byte[recvBytes.length-Header.size()];
    ByteBuffer image = ByteBuffer.wrap(imageBytes, 0, imageBytes.length);Currently, the receiving application uses JOGL to render the frames but my new application needs to implement controls on the data (pause/play/screen capture) and was informed JMF would be a good solution. I have seen a few references as solutions (such as creating a custom DataSource which extends PullDataSource which utilizes a SeekableStream) but I'm not sure if this is in fact the right direction. It seems like if I know the characteristics of the received Frame I should be able to construct the needed object for which to render the frame in a player.
    Thanks,
    Marc

    Apparently I hit a shortcut key and just submitted a partial response (sorry).
    * Create the DataSink.
    DataSink createDataSink(Processor p, MediaLocator outML) {
    DataSource ds;
         if ((ds = p.getDataOutput()) == null) {
             System.err.println("Something is really wrong: the processor does not have an output DataSource");
             return null;
         DataSink dsink;
         try {
             System.err.println("- create DataSink for: " + outML);
             MediaLocator ml = ds.getLocator();
             dsink = Manager.createDataSink(ds, outML);
             dsink.open();
         } catch (Exception e) {
              e.printStackTrace();
                    return null;
         return dsink;
    VideoFormat format = new VideoFormat(VideoFormat.RGB,
              new Dimension(width, height),
              Format.NOT_SPECIFIED,
              Format.byteArray,
              (float)frameRate);Not sure if this is correct:
    public ContentDescriptor getContentDescriptor() {
             return new ContentDescriptor(ContentDescriptor.RAW);
    }or this:
    //          p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));
              p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.RAW));Exception:
    - create processor for the image datasource ...
    Setting the track format to: RGB
    - create DataSink for: file:C:\SMS\workspace\RGBToMovie\myMovie.mov
    javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.RawBufferMux$RawBufferDataSource@61f533
         at javax.media.Manager.createDataSink(Manager.java:1894)
         at com.main.RGBImagesToMovie.createDataSink(RGBImagesToMovie.java:145)
         at com.main.RGBImagesToMovie.doIt(RGBImagesToMovie.java:94)
         at com.main.RGBImagesToMovie.main(RGBImagesToMovie.java:304)
    Failed to create a DataSink for the given output MediaLocator: file:C:\SMS\workspace\RGBToMovie\myMovie.mov

  • Text Message with sent/receive time

    I had a LG Voyager before the DX. When I got a text message it would show the time when the sender sent the message and the time I received it. So if I turned my phone on at 10 am and somebody sent a text at 8 am it would show sent at 8 received at 10. I noticed the DX doesn't do this. I looked in the marketplace for a app that could probaly do this but could not find one. Does anybody know of one or do I need to do something in the settings.

    It looks like "SMS Time Fix" is to address the old issues of Timezone offsets not working properly.
    I did find an app called "SMS Timestamper Fix" on the market that is suppose to help address this issue.
    Google really needs to store both times in the message database and make them available to the applications.
    I also ran across this patch which is suppose to patch the Android OS to store the sent time as opposed to the received time.
    You can also follow this as Issue 2989 over at Google.

  • Difference in information sent / received using externalisable classes

    I am a little unsure whether this is the right place to post, I am relatively new to Java but trying hard to learn it well. However this is quite a specific problem with a personal (for fun) project I have been undertaking and it is driving me slowly insane.
    This is a bit complicated for me to simple post swathes of code so I will attempt to explain. Any help is appreciated as this has been infuriating me for 2-days now.
    Essentially I have made a small game for multiple clients connecting to a server. The client can send a request to move from a position to another to the server and the server responds by moving them and sending them a list of other players at that location, however for some reason at certain points the server will write out what I believe is the correct information to the client but the client will read in something completely different.
    Here is the code which sends the "node" (containing the list of players as well as other information).
    Packet packet = Packet.factoryCreateMovementArrived(publicNode);
    server.sendPacketToClient(playerID, otherPacket);
    public void sendPacketToClient(int playerID, Packet packet) throws IOException
         synchronized(playerIDToOutput)
              ObjectOutputStream obOut = (ObjectOutputStream)playerIDToOutput.get(playerID);
              obOut.writeObject(packet);
    }I wrote my own "packet" class for this which implements the externalizable interface, I factory a certain type of packet and when writing out use a switch to decide what information will be sent. Below is the code for that type of packet (note: the node is also externalisable with a similar method, also included).
    case TYPE_MOVEMENT_ARRIVED:
         out.writeObject(locationNode);
         break;
    case TYPE_PUBLIC_NODE_UNDOCKED:               
         out.writeInt(type);
         out.writeObject(nodeID);
         out.writeObject(shipsSpace);I have examined the packets I am sending out from the server and they contain what I expect however what the client reads in, seems completely different at times and I cannot for the life of me figure out why.
    Here for example are the methods to read in the packet and the node:
    case TYPE_MOVEMENT_ARRIVED:
         this.locationNode = (Node)in.readObject();
            break;
    case TYPE_PUBLIC_NODE_UNDOCKED:                    
         this.type = in.readInt();
         this.nodeID = (String)in.readObject();
         this.shipsSpace = (Vector)in.readObject();And this is used by this method to read in the packet when received from the server:
    while(true)
         try
              Packet messagePacket = (Packet)obIn.readObject();                         
              dealWithPacket(messagePacket);                         
    private void dealWithPacket(Packet packet)
         if (packet.getType() == Packet.TYPE_MOVEMENT_ARRIVED)
              Node toNode = packet.getLocationNode();
              active.arrivedAtLocation(toNode);
         }However by the time it gets to there the data is wrong, the list of people at that node seems to be similar to when the client first logs on. I have debugged my way through the code numerous times and although the server seems to be creating packets containing the correct and current list of players when received at the other end it is simply the list for that node at the beginning of the game. I do not know whether it is possible that although the packet contains the correct list somehow I am sending a different one, but I cannot see how. The same for when constructing the packet with the read methods. .. whether somehow I am not actually reading in what I have sent..
    It's hard for me to explain properly and I cannot exactly post all my code because there's a fair amount of it, however I have been over and over what I have written checking that I am not simply referencing something else, I even wrote the packets I was sending from the server into a file and read that in in another program I wrote and examined them, they were correct! It is infuriating.
    Any help would be greatly appreciated, even simply ideas of how to test this further would be welcome.
    Look forward to your responses and apologise for any obvious errors :)

    So when I'm writing to a stream objects I have already written can essentially be referenced / reused and sent again? I didn't know that but if that's what is happening it explains alot.
    So as I'm sending the same node when you move back to that position it's already in the stream so it simply uses that version? Sorry for asking further questions I just want to make sure I understand what's happening (I went and read the API.. just checking).
    And no warnerja it wasn't a "please simply wave an magic wand and write the project for me", I've seen posts like that from other people. I have written alot of code around this and I simply did not want to post it all. If reseting my output stream solves the problem then someone clearly understood my dilema even if you did not. A more helpful post might have been "You haven't specified enough for me to understand the problem please specify the following ... a) .. b)" etc. Don't simply moan at me.
    Thanks DrClap.

  • How to determine amount of data sent/received by partner

    Here is our situation.  We have PI 7.0 running.  Now we want to charge back to our internal users based on the amount of data sent or received.  Does anyone know where or if the size of the messages are stored; we would like to get the data by receiver. 
    This seems like a simple thing, but I have not been able to find anything on this topic.
    Thanks,
    Rich

    Rich,
    in RWB => Performance monitoring you can filter per interface / receiver / sender / etc.
    All information is available there (size, timestamp, runtime, ...)
    Also you can easily exort data too.
    Check it.
    Regards,
    Kai
    Edited by: Kai Lerch-Baier on Mar 20, 2009 3:14 PM

  • HT201269 How can I backup all my email messages from my ipad2 to my mac. iTunes does not transfer all the sent / received mail.

    Hi,
    I damaged my ipad and saved a backup using iTunes while it was away for repair.
    I used another ipad while it was away, but none of my email messages sent or received had been saved.
    How do I backup my email ?

    hi, not totally, as when the N8 died, the shop here in France couldn't really do much to help and more like didn't want to do much to help, and transferred what data was available from the sim to the mini sim on the apple. Now looking in depth, Windows Contact is an 'orrible application that is not very easy to handle (Windows Address Book is no longer available for anything above Vista and is all tied into Windows Live and things to do with Hotmail and Messenger..... Gatesy is trying to dominate things again..... WOZ HELP!!)
    Sony have worked alongside Apple for a long time, so with a new 12/2012 Experia smartphone, the transfer details are a doddle, but now that Nokia has succombed to being part of the Dark Side (MS) and offering windows phones only, I can understand the retiscence of our late leader and his "heavenly crew" of having to deal with the Dark Side

Maybe you are looking for