Socket.send() and Socket.receive()

Using multi threads
Is it possible to send packet from DatagramSocket while the same Socket is waiting to receive packets?
Do i have to protect this situation?

Send and receive are separate system calls, so as long as you supply different DatagramPackets I don't think you should have a problem. Checking the Solaris docs, these calls are indicated as thread-safe.
Of course, there's no way to guarantee that your particular OS won't do anything strange, so it's a good idea to create some test programs beforehand.

Similar Messages

  • One sender and two receiver

    Hi All,
    I have a scenario in which there is only one outbound Message interface and 2 inbound message interfaces ( one sender and two receiver). In XI, how can i configure the interface determination for this? Shall i need to put * for receiver and add 2 inbound message interfaces and interface mappings.

    Use xpath in your interface determination in case you have some conditions, else u can *** multiple interfaces in your int. det.. also ref:

  • Mapping between Sync sender and Async Receiver

    Hi Experts,
    How to do mapping between Sync sender and Async Receiver?
    Flow: Sync SOAP Sender Client -> First Async webservice call -> Second Sync webservice call
    1. I have to send some input/request details to first webservice call. It will just update the database.If I do mapping with SOAP Sender client and first Async webservice.. I am getting timeout, because it expects response mapping too.
    2. Only Second webservice call return the response back to SOAP Sender client.Here mapping between SOAP Sender client and Second Sync webservice call. I don't have any problem here.
    I have to pass the same request info to both webservice calls, Please tell me how to do the async mapping in BPM?

    Hello Sara,
    Hope these blogs are useful to you..
    /people/siva.maranani/blog/2005/05/25/understanding-message-flow-in-xi - Message Flow in XI
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm - Walk through BPM
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm - Schedule BPM
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - Use of Synch - Asynch bridge in
    ccBPM [original link is broken] [original link is broken] [original link is broken] - Use of Synch - Asynch bridge in
    Satya Kumar

  • Problem between SOAP Sender and JDBC Receiver

    I have a asynchronous scenary between SOAP Sender and JDBC Receiver.
    The idea is sending an ID for updating one register.
    Table structure is:
        (P_RUT                         VARCHAR2(10) NOT NULL,
        P_NOMBRE                       VARCHAR2(50),
        P_APELLIDO                     VARCHAR2(50))
    The ID is the P_RUT field.
    The structure of message that I send by SOAP, is the following:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:SOAP-ENC="" xmlns:xsi="" xmlns:xsd="">
              <m:MT_CONS_SOAP xmlns:m="urn:prueba:voliva">
    The JDBC receiver structure is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_CONS_PERSONA xmlns:ns0="urn:prueba:voliva">
              <AS_PERSONA action="UPDATE">
    When I do a call to SOAP by XMLspy, it returns a message without data, that means succesfull reply.
    I see message monitor and see the succesfull flag. But in the database it doesn't update the register.
    This scenario was proved using the File Sender and same JDBC Receiver, then result was succesfull.
    I proved SOAP Sender with a File Receiver, storing information from SOAP sender in an archive, and works well.
    Then I imagine that exist some problem between SOAP and JDBC. what could be happening ?

    Looks like the problem is with the JDBC receiver...try updating the value in the table by using a File-JDBC scenario..does it work..check the adapter monitor in RWB..

  • Integrtion Scenario using BPM with two sender and multiple receiver

    integrtion Scenario using BPM with two sender and multiple receiver
    How many Application Components are required?

    Hi Vinod,
    1) In integration repository you can have one or many software components it depends on your landscape orchestration
    2) In integration direcory you need at least one service for bpm and one or many for each system in your bpm
    also each connection between systems and bpm must have receiver determination and so on.
    Advice: Please treat BPM as a separate system.

  • RFC Sender and RFC Receiver Sync Scenario . Help required.

    I need to make RFC Sender and RFC Receiver Sync Scenario.
    Any docs/links for it.

    I have CRM (r/3) and DM (r/3)system.
    Data from differnent tables of CRM system needs to go to
    DM system different tables , data will be saved there and then return response back to CRM system.
    For this I have given one RFC for CRM system
    For this I have given one RFC for DM system
    So I have to make Sync Outbound Interface
    and Sync Inbound Interface.
    So I think so no BPM is required.I am correct?
    Adapter -- RFC Sender and RFC Receiver Adapter.
    Edited by: Henry H on Jan 29, 2008 11:20 AM

  • My sender and the receiver message types structures are I need to m

    Hi all,
    My sender and the receiver message types structures are I need to mapping in this case.
    If it is not required .Let me know in detail,How to proceed.

    If is just to pass the message (as the sender source is the same as the receiver source),
    first you should have the Message Interface of you message
    then you should configure the Receiver determination, as the sender interface use your message interface and in the interface determination you can use the same message interface (same name). You dont have to add any mapping, just let empty and save. Just use one message interface for sender a receive.
    Any questins let me know.

  • How can I view The date, time, sender and/or receiver of a text message online?

    I would like to view the date and time sender and receiver of my text messages I read it can be done. I can't find where. If somone one could point me out in the right direction I would appreciate it. Thanks

    Log into your account and to the right of the phone photo you will see usage details in blue then on the next screen pick the phone on the account you want to see the details for and under that you can click to see eveyrthing in detail.  Mary

  • RFC sender and SOAP receiver data is not posting

    Dear Experts,
    we creating one scenario
    R3-PI-Third party(WSDL).so we are creating  RFC as Sender and SOAP as SXMB_MONI no error.Message monitoring also showing delivered and both payloads also showing.but in thirdparty system data is not posting.third party system is handling messages, but not showing any error also.we call the WSDL using WSNAVIGATOR to post data working fine.

    Dear Stefan,
    we are getting below message in TCP Gateway.
    POST /AdvancedMeteringInfrastructure-UtilitiesDeviceERPSmartMeterBulkCreateRequest-context-root/UtilitiesDeviceERPSmartMeterBulkCreateRequest_OutPort?wsdl HTTP/1.0Accept: /Host: gts-poc1:50081User-Agent: <soap-00237D5E14C01DEF9BC72C1A7C0FFCA3(at)>Content-Type: text/xml; charset=utf-8Content-Length: 1746SOAPACTION: ""<SOAP:Envelope xmlns:SOAP=''><SOAP:Header/><SOAP:Body><ns1:UtilitiesDeviceERPSmartMeterBulkCreateRequest xmlns:ns1=''><MessageHeader><ID schemeID='Device' schemeAgencyID=''>4446364533373842</ID><UUID schemeID='Device' schemeAgencyID=''>DF6E378B-D76E-DDF1-B9A3-0013725B3FAB</UUID><CreationDateTime>2010/06/02 T16:54:17</CreationDateTime><TestDataIndicator>true</TestDataIndicator><ReconciliationIndicator>true</ReconciliationIndicator><SenderBusinessSystemID>SLD_B001</SenderBusinessSystemID><RecipientBusinessSystemID>SLD_B002</RecipientBusinessSystemID></MessageHeader><UtilitiesDeviceERPSmartMeterCreateRequestMessage><MessageHeader><ID schemeID='Device' schemeAgencyID='' schemeAgencySchemeAgencyID='001'>4446364533373842</ID><UUID schemeID='Device' schemeAgencyID=''>DF6E378B-D76E-DEF1-B9A3-0013725B3FAB</UUID><CreationDateTime>2010/06/02 T16:54:17</CreationDateTime><TestDataIndicator>true</TestDataIndicator><ReconciliationIndicator>true</ReconciliationIndicator><SenderBusinessSystemID>SLD_B001</SenderBusinessSystemID><RecipientBusinessSystemID>SLD_B001</RecipientBusinessSystemID></MessageHeader><UtilitiesDevice><ID schemeID='DEID' schemeAgencyID='115'>1200000120001556</ID><StartDate>2010.06.02</StartDate><EndDate>9999.12.31</EndDate><SerialID>1200000120001556</SerialID><MaterialID schemeID='MaterialID' schemeAgencyID='MPL_002'>85</MaterialID><ProductUniqueItemID schemeID='Smart Meter' schemeAgencyID='MPL_002'>SM1165HS</ProductUniqueItemID></UtilitiesDevice></UtilitiesDeviceERPSmartMeterCreateRequestMessage></ns1:UtilitiesDeviceERPSmartMeterBulkCreateRequest></SOAP:Body></SOAP:Envelope>
    HTTP/1.1 404 Not Foundconnection: closepragma: no-cachecache-control: no-cacheexpires: 0sap-isc-etag: J2EE//content-type: text/htmlcontent-length: 1571server: SAP NetWeaver Application Server 7.10 / AS Java 7.10date: Wed, 02 Jun 2010 11:24:17 GMT<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head>     <title>Error Report</title><style>td {font-family : Arial, Tahoma, Helvetica, sans-serif; font-size : 14px;}A:link A:visited A:active </style></head><body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" rightmargin="0"><table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75"><tr bgcolor="#FFFFFF">    <td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="4" color="#666666"><b>  404 &nbsp Not Found</b></font></td></tr><tr bgcolor="#3F73A3">    <td height="23" width="84"><img width=1 height=1 border=0 alt=""></td>    <td height="23"><img width=1 height=1 border=0 alt=""></td>    <td align="right" height="23"><font face="Arial, Verdana, Helvetica" size="2" color="#FFFFFF"><b>SAP NetWeaver Application Server 7.10 / AS Java 7.10 </b></font></td></tr><tr bgcolor="#9DCDFD">    <td height="4" colspan="3"><img width=1 height=1 border=0 alt=""></td></tr></table><br><br><br><br><br><br><p><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><b>  The requested resource does not exist.</b></font></p><p><font face="Arial, Verdana, Helvetica" size="2" color="#000000"><table><tr><td valign="top"><b> Details:</b></td><td valign="top"><PRE>Go to <A HREF="/" target="_parent">main page</A> of this application!</PRE></font></td></tr></table></font></p></body></html>

  • FTPS Sender and FTPS Receiver adapter. Pls help

    Hi All,
    I need to make file to file scenario with secure connection
    I am using FTP Sender and Receiver Adapter with Connectivity
    as FTPS.
    Please let me know the steps I need to do for this
    1. Integration Directory
    2. If I need to generate certificates what steps I need to do:
        a. How to generate certificates
        b. Where to install these certificates like File Servers, XI
            Server etc.
    3. How to use these certificates in File Server, Integration
       Directory etc.
    Please send me a document to do all steps.
    In advance thanks and Full Points will be awarded.

    Deploy SAP Java Cryptographic Toolkit.&
    Add the CA certificate to the key storage as below.
    Keystore: service_ssl
    X.509 Certificate & Private Key: ssl-credentials
    This means that you need to import the CA hierarchy of your FTPs server certificate into the list of trusted CA's in XI ( either on J2EE side in the keystore service or in ABAP side via transaction STRUST , depending on where your client is ).
    If connection security parameter in communication channel for Sender FTP Adapter is set to "FTPs( FTP Using SSL/TLS) with Control Connection" only, file gets successfully created with data at the FTP server but as soon as we switch the connection security parameter to "FTPs( FTP Using SSL/TLS) with Control and Data Connection".The initial handshaking happens successfully and file gets created at the FTP Server but its empty, connection fails when attempt is made to write data into file and we end up with said error thereby closing the connection.
    SAP Note 821267
    Refer below link
    SAP Network Blog: SFTP vs. FTPS in SAP PI

  • HTTP Sender and HTTP Receiver .Pls advice urgent

    Hi All,
    Partner A (http) -- XI -
    Partner B(http)
    Now Trade Partner do not want to use HTTP client tool.
    He wants to send data through URL.
    Please make the full sender URL for the details below
    for Sender HTTP:
    XI system -- sapd0aa
    Client -- 100
    Port -- 8000
    Sender Service -- SS
    Sender Interface -- SI
    Sender Namespace -- http:
    Qos -- EO
    In Receiver HTTP Aadapter if I use RFC Destination does it has to be of Type G

    Hi Henry,
    1. Where sender partner will send his XML if he uses the above URL?
    Whatever technology , partner is using to send the data, there are some APIs available for establishing the http connection and then sending the data on this HTTP connection.
    2. How the user name and password will be sent in the above URL as XI requires User Name and password.
    You can embed in the URL by adding sap-user=xyz&sap-password=abc

  • HTTP Sender and HTTP Receiver adapter. Pls advice urgent

    Hi All,
    There is one Third Party that wants to send XML data and receive XML data with XI.
    Please let me know can I use HTTP for that.
    How to use HTTP Sender part?
    How to use HTTP Receiver Adapter?
    Pls send blogs/doc for that
    Thanks and Regards

    Check this thread for the code for a HTTP Client,
    /message/266750#266750 [original link is broken]
    Also, check these blogs. They use HTTP adapters for their configuration,
    Check these links for the configuration part.
    Weblog :
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - although this weblog is
    aimed at explaining the sync-async bridge.. Sriram has taken http-to-file scenario as the example
    note:reward points if solution found helpfull.....

  • SOAP sender and IDOC receiver

    Could u please help me, how to do this interface.
    I am transferring the PO from legacy system(webServices Request) to SAP system when ever PO_IDOC is created in SAP I need to send PO number and Acknowledge back to the legacy system.This is synchronous communication from SOAP to IDOC.

    you can use the ORDRSP ORDERS05 Idoc for PO response.
    So your scenario will be
    SOAP Req -> IDoc -> IDoc resp -> SOAP Resp
    but if you can have a standard RFC or maybe an ABAP proxy you can make the scenario sync from SAP end.

  • File Sender and Mail Receiver .....what is the error all about?

    Dear All,
      I am trying to send a file using mailpackage to my Lotus Notes id.But it is giving the below mentioned error.
    <b>error occured: [2005-09-28T11:42:43Z] unable to call the mailer; Failed to call the endpoint [null "null"]; nested exception caused by: Connection refused: connect</b>
    The below mentioned is my Input File.
    <b><?xml version="1.0" encoding="UTF-8"?>
    <ns:Mail xmlns:ns="">
       <To>[email protected]</To>
       <X_Mailer>Lotus Notes</X_Mailer>
      <Content>Hi ra.</Content>
    and my Mail Adapter Configuration for this is,
    <b>Transport Protocol: SMTP
    Message Protocol: XIPAYLOAD
    Adapter Engine: Integration Engine
    URL: smtp://mailservername
    Use Mail Package is checked and
    Encoding : None</b>
    1.Should I have to have an access to the Mail Server?
    2.Why is the error?
    3.What all Configuration I need to change,if any?
    4.How to solve the error?
    Without running the scenario,when I went to Monitor ,it was showing,
    <b>MyConfig. Scenario:MyMailAdapter as running:started</b>
    Please help me to solve this problem.
    Thank You

    No Stefan,
      I don't have SP10.
    Do I need make any new configuration on the Mail Server side or i can carry on with the existing corporate one (which I am not supposed to touch)?
    I haven't created any mail server of my own.But I want to send that file to my corporate domain or my <b>yahoo</b> domain for example.Now should I need to make any new configuration or configuration changes on my Integration Server?
    I am very much confused in this regard.I have not made any other configuration other than that of Mail Adapter and File Adapter(ie,only XI related configurations).
    I didn't even configured my own smtp server.
    This is what I have done so far.Can you please through more light on it?
    Thanks in Advance,
      Sugata Basu

  • Fax error(Fax locked) no send and no receive faxes

    "Fax out of use".Fax is"locked from the administrator or from whom has install the machine" .This message with a lock icon i can see on the screen.The fax was ok till the moment i was looking for updates through my laptop.Any suggestion?
    Thank you. 

    Hi @Pavlos1 , and welcome to the HP Forums!
    I see you are having fax administrative options. I would like to assist.
    I would recommend entering your printers IP address in an internet browser. This should open the Embedded Web Server. In the server, select Administrative Settings.  In there, you can unlock the fax.
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Send and receive file through ServerSocket

    Hi all!
    I try to send and then receive file via Server Socket but something goes wrong.
    I can send file from Client to Server, but after that I couldn't receive another file from Server to Client. What might be the problem?
    ex Client:
    public class FileClient{
      public static void main (String [] args ) throws IOException {
        int bytesRead;
        int current = 0;
        Socket sock = new Socket("localhost",13267);
        System.out.println("Try to send...");
        //send file
        File myFile = new File ("sourceImg.jpg");
        byte [] mybytearrayTOSend  = new byte [(int)myFile.length()];
        FileInputStream fis = new FileInputStream(myFile);
        BufferedInputStream bis = new BufferedInputStream(fis);,0,mybytearrayTOSend.length);
        OutputStream os = sock.getOutputStream();
        System.out.println("File was sent...");
       System.out.println("Try to receive...");
        // receive file
       byte [] mybytearray  = new byte [filesize];
        InputStream is = sock.getInputStream();
        FileOutputStream fos = new FileOutputStream("source-copyImg2.jpg");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        bytesRead =,0,mybytearray.length);
        current = bytesRead;
        do {
           bytesRead =
    , current, (mybytearray.length-current));
           if(bytesRead >= 0) current += bytesRead;
        } while(bytesRead > -1);
        bos.write(mybytearray, 0 , current);
        System.out.println("File was received..");
    }ex Server
    public class FileServer{
    public static void main (String [] args ) throws IOException {
        ServerSocket servsock = new ServerSocket(13267);
        while (true) {
          Socket sock = servsock.accept();
          System.out.println("Accepted connection : " + sock);
          // receive file
          int filesize=6022386;
          int bytesRead;
          int current = 0;
          byte [] mybytearrayIn  = new byte [filesize];
          System.out.println("Try to receive...");
          InputStream is = sock.getInputStream();
          FileOutputStream fos = new FileOutputStream("source-copyImg1.jpg");
          BufferedOutputStream bos = new BufferedOutputStream(fos);
          bytesRead =,0,mybytearrayIn.length);
          current = bytesRead;
          do {
             bytesRead =
      , current, (mybytearrayIn.length-current));
             if(bytesRead >= 0) current += bytesRead;
          } while(bytesRead > -1);
          bos.write(mybytearrayIn, 0 , current);
          long end = System.currentTimeMillis();
          System.out.println("File was received...");     
          System.out.println("Try to send file...");
          // sendfile
          File myFile = new File ("sourceImg2.jpg");
          byte [] mybytearray  = new byte [(int)myFile.length()];
          FileInputStream fis = new FileInputStream(myFile);
          BufferedInputStream bis = new BufferedInputStream(fis);
          OutputStream os = sock.getOutputStream();

    ex Client:
    public class FileClient{
    current = bytesRead;
    This assignment is pointless. At this line, bytesRead and 'current' are already both zero.
    do {
    bytesRead =, current, (mybytearray.length-current));
    if(bytesRead >= 0) current += bytesRead;At this point, if mybytearray.length == current, you are done, and the read will return zero, so you should test for a zero return ...
    } while(bytesRead > -1);... not just a -1 return.
    ex Server,0,mybytearray.length);
    Here you are ignoring the result of the read, which can be anything between 0 and mybytearray.length. Don't do that.

Maybe you are looking for

  • CSS 11501 Load Balancing with X-forwarded-for

    Hi, We have a pair of CSS 11501, Currently it is using source ip for load balancing and 5 servers as backend , however we have users loggin in using http and based on its source IP (ISP PROXY) , it is forwarded to SERVER A. However, we have a SSL pag

  • Is P6 R8 Compatible with PPM 8.0 ?

    Hi, I would know if someone tested the compatibility of PPM 8.0 with P6 R8 (by the Bridge ) I will not upgrade to P6 R8, but this info could be useful on some customer site. Thanks Fabio D'Alfonso

  • Browser homepage not displaying. Suspect speedialwas the cause.

    I lost my firefox homepage display when trying to remove speedial as advised. This happened at the final step clicking on Firefox options. I now have to access my e mail via the start menu which is cluttered and slow.

  • IPhoto file locations??? Actual file or just a "shortcut" ??? PLEASE HELP

    I don't know why but this confuses me, I recently realized I can use iPhoto just as i use iView Media as an organized photo album. Currently I have all my pictures stored on my HD in multiple folders (by year, topic, event, etc.) Thru iView Media I c

  • Libx264, why is it making me miserable?

    I've recently recieved footage (.mov) from someone that looks great in quicktime but starts giving me troubles when I try to do...basically anything to it.  Importing, transcoding, converting.  When I try importing the footage into Final Cut Pro X, i