How to read messages longer than network buffer size

The logic of my application is:
the client sends a request to the server and wait, in blocking mode, for its response.
The server can responde with strings longer than 64KB (size of their sending and receiving buffer size), so under the hood, can also execs more than one socketChannel.write
Nothing in the message says where it finish, nevertheless the client needs to assemble all in one big
string.
How can the client deal with this ? I'd like keep it as simple as possible (without using a selector)
any thoughts ?
thanks in advance

Your above post suggests that it can send more than one packet (even ignoring the 64k limit.)
In that case the data of the message must contain sufficient information. If not then the solution is not determinate.
Ideally what you should received is a message and not just data. The message defines it contents. So you know how long it is and maybe even when it ends.
Alternatively the data might contain something. For example if you are recieving well formatted XML then you can create a simple parser that just looks for the end tag. If it isn't well formatted, or at least you can not rely on that then it is much harder.

Similar Messages

  • Spam_scan: not wasting time on SA, message longer than

    So this is a bit strange... well to me it is.
    The size of the spam emails seems to be getting bigger, so I increased $samail_body_sizelimit first to 512 and then 1024 (which I thought was 1Meg)
    $samail_body_sizelimit = 1024*1024;
    However, I'm still seeing this, which seems odd - to me:
    Jun 23 00:14:33 server amavis[1806]: (01806-12) ESMTP::10024 /var/amavis/tmp/amavis-20090622T213134-01806: <[email protected]> -> <[email protected]> SIZE=335064 Received: from email.clayford.com ([127.0.0.1]) by localhost (email.clayford.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for <[email protected]>; Tue, 23 Jun 2009 00:14:33 +0100 (BST)
    Jun 23 00:14:33 server amavis[1806]: (01806-12) smtp connection cache, dt: 1119.1, state: 0
    Jun 23 00:14:33 server amavis[1806]: (01806-12) Checking: ldKRucT2xo+o [209.250.234.229] <[email protected]> -> <[email protected]>
    Jun 23 00:14:33 server amavis[1806]: (01806-12) p005 1 Content-Type: multipart/related
    Jun 23 00:14:33 server amavis[1806]: (01806-12) p007 1/1 Content-Type: multipart/alternative
    Jun 23 00:14:33 server amavis[1806]: (01806-12) p001 1/1/1 Content-Type: text/plain, size: 147 B, name:
    Jun 23 00:14:33 server amavis[1806]: (01806-12) p002 1/1/2 Content-Type: text/html, size: 3875 B, name:
    Jun 23 00:14:33 server amavis[1806]: (01806-12) p003 1/2 Content-Type: image/jpeg, size: 202784 B, name: image005.jpg
    Jun 23 00:14:33 server amavis[1806]: (01806-12) p004 1/3 Content-Type: image/jpeg, size: 5518 B, name: image006.jpg
    Jun 23 00:14:33 server postfix/smtpd[2950]: disconnect from 209-250-234-229.ip.justedge.net[209.250.234.229]
    Jun 23 00:14:33 server amavis[1806]: (01806-12) spam_scan: not wasting time on SA, message longer than 262144 bytes: 643+334420
    Jun 23 00:14:34 server amavis[1806]: (01806-12) SPAM-TAG, <[email protected]> -> <[email protected]>, No, score=x tagged_above=-999 required=2.5 tests=[] autolearn=unavailable
    Jun 2

    See, I only had to post a question and it goes and fixes itself. Cannot see what had changed - I took 1024 back to 512 and 'seems' be happy now!

  • How do I print more than one custom-size photo on a page in PSE 10?

    I recently upgraded from Photoshop Elements 6 to Photoshop Elements 10.  I make greeting cards, and on PSE 6 I was able to print two custom-size (6-1/2” x 5”) cards on each 8-1/2” x 11” sheet of photo paper.  The option to print more than one custom-size card on a single sheet of paper is not available in PSE 10.  I want to know how I can print more than one custom-size card (or photo) on a page in PSE 10?

    In Editor:
    File>Print>#4 Select type of print>picture package

  • How to send video longer than 1 minute?

    I'd like to send some video to youtube that is longer than a minute. As far as I can tell, this is impossible...?
    OR, if this cannot be done, can I edit my video down?
    (sorry, I briefly searched this topic and didn't see anything right away).
    Thanks!

    This is more than likely a carrier restriction. Carriers set their own limits and most set the limits at 300kb or 600kb. You could enquire about your carriers limit. With a fixed limit, the higher the resolution, the shorter a file you can send. I presume the iphone has a lower resolution option. 

  • Reading Text longer than 132 Characters including Special characters

    Hello Seniors,
    Could you please give me some information about the following Function Modules also?
    'SOTR_STRING_CREATE_CONCEPT'
    'LXE_OBJ_TEXT_PAIR_READ_SOTR'
    'SOTR_STRING_READ_TEXT_WITH_KEY'
    I was able to create a concept by using the Function module 'SOTR_STRING_CREATE_CONCEPT'. Now, I need to create a text and then read the text where ever I want (the text can be longer than 132 characters and also may contain special characters) from abap functions as per my requirement.
    my requirement is not based only on SAP Scripts.
    Thank you,
    cnc.

    check in  url    www.SE37.com
    regards,
    Prabhu

  • How to make narration longer than 30 seconds?

    To whom it may concern,
    I have a question about Adobe Premiere Elements 11. I want to record for more than 30 seconds, do you know if there is a way make narration longer than 30 seconds?
    Thank you.
    Adobe 206

    Adobe 206
    Are you saying that you attach a microphone to your computer and run the Premiere Elements 11 narration feature and can get no more than a 30 second narration .wav file from the feature?
    Please check out the following thread in which I was involved and let us know if any of its discussion applies ot your situation.
    http://www.elementsvillage.com/forums/showthread.php?t=61237
    Any questions about that thread, please ask me here in your thread.
    Thanks
    ATR

  • How do you determine ip and op buffer size on a 3550-12G

    I have a Cisco 3550-12G switch and I want to check to see if the input buffers and the output buffers for port gi0/12 are the same size. Is there a simple way to do this, I tried using the show buffers command but I couldn't seem to find what I was looking for. Help!

    Hi,
    "The 3550 switch uses central buffering. This means that there are no fixed buffer sizes per port. However, there is a fixed number of packets on a Gigabit port that can be queued. This fixed number is 4096. By default, each queue in a Gigabit port can have up to 1024 packets, regardless of the packet size."
    http://www.cisco.com/warp/public/473/187.html#topic7
    HTH,
    Bobby
    *Please rate helpful posts.

  • How to read messages in message pool from a java file

    Hi All,
    I want to read a message that is defined in a message pool of a webdynpro component.
    This reading should be done from a java file present in the "src" folder.
    How can I get the handle to the IWDComponent?
    Or is there any other way?
    Or is there any way of reading localized messages in a java file of a webdynpro component?
    Can you kindly guide me out of this issue?
    Thanks and regards
    RB

    Hello,
    my approach is more simple: how can I read within component A the message pool of another webdynpro component B ? Component A has a usage relation to component B .
    I tried this within component A:
    <b>this.wdThis.wdGetBInterface().wdGetAPI().getComponent().getTextAccessor().getText("ANY_TEXT");</b>
    I got the exeption:
    <b>java.lang.UnsupportedOperationException: Embedded Components are black boxes. You should not access parts which are not in their interface</b>.
    Is there any way to share message pools ?
    Thanks
    Kerstin

  • How to read the long text in Transaction Code : VA02 at runtime??????

    Hi,
    I am undable to find the long text in TC: VA02 at runtime. Actulally my requirement is like how to compare between the item level long text at runtime and existing long text for that item.
    If any body has soluntion, please provide me. I would really be  greatfull if any body provide the solution.
    Deepak Kumar
    E-Mail: [email protected]

    Hi Sudheer,
    Actually my requirement is to read the text at runtime. Example: If saved text is 'ABC' and it is changed by '123'. Now before saving changed text '123', I need to capture it so that I can compare it with saved text 'ABC' whether it is changed or not?
    Couuld you send me some sample code? I would appreciate if you reply at the earliest.
    Deepak Kumar.

  • How to Read Message from JMS Queue using Business Service(ALSB3.0)

    Hi,
     My Project Set up is as follows(using ALSB3.0).
    1>One Proxy Service with transport as HTTP.
    2>The Proxy service is calling another Business Service.
    3>The Business Service has transport layer as JMS.
    So here the business service is posting Request Message into the JMS queue.
    I want at the same time it(The Business Service) should listen to another queue and from there it should read Response Message and forward back to the caller proxy service.
    Can any one help me regarding this...
    Thanks in advance...
    Deba

    Hi ,
    Problem in : Reading / writing messages to the JMS Queue -
    I am stuck with the same problem and I am not able to proceed futher, Can you please help me out in sending an example of how to do right configurations in ALSB and on the server. I read the documentation but still I dont see messages in the queues.
    please help me out. can you post a small sample example
    thanks
    adi

  • How to read message from Active MQ using OSB

    Hi All
    I want to read from Active MQ ( situated on another server) using OSB (11g). My condition is
    Active MQ---> OSB---> DB Tables
    I know how to use BPEL to do this but I need to use OSB to do this. Client which puts data to Active MQ also puts data ( like eventtype)to its header and on basis of header(eventtype) I need to route the message to proper tables. Please let me know how can I do this and if any step by step info is available for this ( I checked on many blogs but couldn't find any).
    Thanks very much
    Regards
    Gaurav

    Did you try creating a MQ transport proxy service in OSB -
    http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15866/mq.htm#BGEFJHAF
    Regards,
    Anuj

  • How to embed URL (Longer than 60 Chars) into CRM-Web UI

    Hello
    i would like to have a textfield with an URL embeded into the Incident UI
    So far i managed to create the Char-Field and fill it with the URL
    Unfortunately the generated Fields are limited to 60 Chars, but i need 100 for the URL with all parameters to work.
    At the Moment the URL is truncated to 60 chars which leaves the link unfunctional
    Any Ideas would be appreciated.
    Kind regards
    Rolf

    Hi Rolf,
    I build a simple URL shortener in our system similar to ABAP URL shortener
    The concept is quite easy. You store the source URL in a table and use a unique short-id instead. In my case I use function GENERAL_GET_RANDOM_PWD to generate the id for a given length (e.g. aBcD3). In addition, I created an ICF node 'ID' with a handler class that passes the short URL (e.g. http://mycompany/id/aBcD3) to the corresponding long URL, which can be internal or external.
    The other option is to split the URL path into string_table and store the last entry, like:
    lv_path = server->request->get_header_field( '~path_translated' ).
      IF NOT lv_path IS INITIAL.
        SPLIT lv_path AT '=' INTO TABLE lt_path.
        DESCRIBE TABLE lt_path LINES lv_lines.
        READ TABLE lt_path INTO ls_path INDEX lv_lines.
        lv_guid = ls_path.
      ENDIF.
    Regards, Richard

  • How to read messages from mqseries continuously by java?

    Hi,
    I'm sending messages to the queue of MQSeries.
    Here my requirement is i have to write a java/jms program that should run at the back side and check the queue  for every 5 minutes for messages.If any message exists in the queue the java/jms program should read the message and display it on the console.
    If anybody has idea please reply it.
    thanks in advance

    Hi!
    You have many ways. You could define a cron on a UNIX box to make sure a simple command line app connects to the queue every 5 min and uses JMS API to read the queue and do whatever you need with the messages.
    http://java.sun.com/products/jms/javadoc-102a/index.html
    On the other hand, unless its critical to recover messages just every 5 min., you could create an MDB. Actually this is the best solution: a Message Driven Enterprise Java Bean is just a listener over the queue reacting instantly to every message received. The way to create and configure them depends strongly on your appserver and development process: an IDE as WSAD or something like that creates them very easily. The actual problem with these ones is to properly configure them on your appserver. However, all appservers will allow you to define a 'Foreign JMS Provider' or something like that pointing to the actual MQ implementation you have and define an activation specification on which to sit your MDB.
    Regards
    Jorge

  • How to read messages from IBM MQ's by using MDB

    Hi All,
    Can anybody help me,My requirement is like MDB will listen to a MQ and then inserting this message in to the data base table.This MDB projet has to deploy in weblogic server.Plz rovide any documents or else sample code.
    Thanks
    Mani

    Mani wrote:
    Thx PhHein,
    For ur quick reply,there is no such information for meeting my requirement. Then I guess you should be looking for another solution. I'm pretty sure you just need to perform better research though. Try different search terms, spend more time reading and comprehending search results, etc.

  • How to read messages from AQ

    hi,
    is there any possibility to view the messages of queue? Is there any query to view all messages that are present in the queue? I can able to dequeue message using Java client. But i would like to see messages present in the queue using some query/procedure?
    Thanks,
    naga

    Hi,
    You can check the view AQ$queue_table. where "queue_table" is the name of your queue table.
    Regards,

Maybe you are looking for