Data transfer between C client and Java server

Hello there
I am working on a project where I have to develop a Client based on C and Server based on Java. The client can connect to Java server and it then sends a integer/string to Java server. But.. Java server unable to receive that and throws an IOException.
I use write method to send the integer buffer to the socket.
int out_buffer = 0;
int *pbuf;
pbuf = &out_buffer;
     if (write(acskfd, pbuf, 4)< 0){
               syslog(LOG_ERR,"Write failed. %s(%d)", strerror(errno), errno);
               printf("\tCLIENT:\tWrite failed\n");
               exit(1);
In Java, i use DatainputStream and readnInt method to read the integer from the stream.
cl_sock = socket_out.accept();
DataInputStream sInput =new DataInputStream(cl_sock.getInputStream()) ;
int cmd = sInput.readInt();
Am I missing someting.. Any suggestions would be really really helpful.
Thanks
Ithaca
PS: I running both programs in the same machine.
In C part, I also use host to network byte order conversion (serv_addr.sin_port = htons(portno).

I would suggest writing a Java client to perform the same tasks as the C client.
Then if the Java client does, or does not work this can help dteremine which end is at fault.
Are you flushing your data from the client?

Similar Messages

  • UDP DatagramPacket sent between C (client) and Java (server)

    Hi,
    I have a problem sending a struct from C to Java UDP server.
    In the C (client) program, the struct is defined as
    typedef strurct dataType_s {
    char name[52];
    char add[52];
    long x;
    long y;
    } dataType;
    dataType data;
    strcpy(data.name, "sun");
    strcpy(data.add, "com");
    data.x = 100;
    data.y = 50;
    sendto(sock, (struct dataType*)&dataType, sizeof(dataType), (struct sockaddr*)&dest, sizeof(dest))
    In the Java server side, I have the following code.
    byte[] buffer = new Byte[1024];
    DatagramPacket packet = new DatagramPacket(buffer, 1024);
    udpSock.receive(buffer);
    byte[] data = buffer.getData();
    String name = new String(data, 0, 52);
    String add = new String(data, 52, 52);
    String _xx = new String(data, 104, 4);
    String _yy = new String(data, 108, 4);
    Byte x = new Byte(xx.getBytes());
    long x = _x.longValue();
    Byte y = new Byte(yy.getBytes());
    long y = _y.longValue();
    I am having problem to read the contents of x and y above. The string name and add received by the server
    are correct. However, I receive garbage value
    for x (long) and y (long). In fact, I get expection
    that I cannot create Byte x and Byte y as shown
    above. Any idea of how to send a mixture of types
    from C/C++ to Java server?
    Thanks a lot.
    Kelvin ([email protected])

    sendto(sock, (struct dataType*)&dataType,
    sizeof(dataType), (struct sockaddr*)&dest,
    sizeof(dest))You have to check the alignment of your structs. You can't be sure that a long takes up four bytes. It can very well be 8 bytes or something else depending on your settings at compilation.
    udpSock.receive(buffer);
    byte[] data = buffer.getData();I suppose this is a typo, but of course you should use packet not buffer here.
    >
    Byte x = new Byte(xx.getBytes());
    long x = _x.longValue();
    Byte y = new Byte(yy.getBytes());
    long y = _y.longValue();
    in my opinion its easier to use a DataInputStream instead:
    DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
    int y = in.readInt();
    Notice that a long in Java is 8 bytes. A C long corresponds to a Java int.
    /Per-Arne

  • Difference between oracle client and oracle server?

    Hi,
    could any one please tell me the difference between these things?
    1.)oracle client and oracle server
    2.) installtion of oracle client and oracle server
    Thanks in advance.

    Take a look at the general client - server computing model, described e.g. in this wiki.
    edit:
    corrected bad link
    Message was edited by:
    orafad

  • Vendor Master Data Transfer Between the Clients

    Hello Everyone,
    I want to transfer Vendor master data between the clients, can any one help me in this Please?
    I don't want to use LSMW, Is there any other method by which i can copy the vendor between the clients or i have to do it manually?
    Please Help ASAP
    Thanks
    M

    Hi,
    You have to do necessary setting for ALE and IDOC will get generated and data will get transfer based on the Program Schedule in Bacground.
    You can schedule program in bacground as per your requirement of IDOC transfer and data generation from One Client to other. [i.e. end of the day, Hourly, monthly etc.]
    Regards,
    Manish

  • NFS problem between RedHat Client and Solaris Server

    Hi all, we are experiencing a problem between a RedHat client and a Solaris 10 server. For the purposes of this post, I'll call the Redhat client server A and the Solaris 10 server B.
    Server B is exporting a filesystem that server A is trying to mount. Server A can successfully mount the exported file system, however, strange things are happening. If I change to the exported mount point on server A and create a file, the file is owned by nobody:nobody, not the user that created the file.
    A look at the file on server B shows the file has the correct UID and GID (ie the UID & GID of server A).
    The fstab file on server A looks like this:
    serverB:/data /data nfs4 rsize=32768,wsize=32768,hard,nointr,rw,bg,actimeo=0,timeo=300,suid 0 0
    Does anyone have a explanation for this?
    NB: There is a firewall between server A and server B. A firewall rule is in place to allow traffic between the two servers on port 2049
    Stewart

    Hi
    If I change to the exported mount point on server A and create a file, the file is owned by nobody:nobody, not the user that created the file.On a NFS share, for security reasons, you normally dont have root provileges.
    A file createt as root user will be mapped to nobody:nobody.
    The behaviour you see is correct.
    If you want the file to be createt as root, you have to export the filesystem with -o ro,anon=0
    NFSv3 will be blocked by your firewall.
    Franco

  • Inconsistent date formats between Rich Client and HTML client

    Hey All,
    Just wondering if anyone has come across an issue with inconsistent date formats from a universe based on an MS SSAS 2012 database connection in 4.x?
    The value of the date is returned as a string from the query but the object data type has been changed to a Date object meaning BusinessObjects should convert the string into a date if the format is correct.
    The problem in this is that the date being returned in Rich Client is in dd/MM/yyyy format whereas on the Web Client is in MM/dd/yyyy.
    From the Web Client business objects will return a date, however, it is a mix of MDY and DMY format.
    i.e. 15th of March will be displayed as 15/03/2014
    whereas 12th of March will be displayed as 03/12/2014
    All our application servers are configured for English (Australian) regional settings meaning all dates should be in DMY format.
    The date in the database is stored as a non-ambiguous yyyy-mm-dd format so it appears the variation is occurring somewhere between the database and BusinessObjects for the Web Client based reports only.
    I have also checked the sqlsrv.prm file based format and changed this to DMY but this has also not made a difference.
    The same universe in 3.1 and MS SSAS 2008 works correctly but not this one.

    Hi
    The date in the database is stored as yyyy-mm-dd format.
    As per user request.... Set the date format @ the Business layer level. so it will refelct same as in the WebI.
    Please find the below link. how to use custom Display option.
    BI4.1 Business Layer Enhancements - Create Display Format

  • Data transfer between EREC 606 and HR system EHP5

    Hi All,
    we have similar scenario to the discussions:
    http://scn.sap.com/thread/3513535
    http://scn.sap.com/thread/3513421
    with that abbreviation that out system hosting partner has recommended EREC 606 as the right level. The main reason was as I recall that our SAP Portal is on the level 7.31.
    As I see in that discussions others are using EREC 605 with ERP EHP5.
    Our integration between ERP (HR) and EREC will be limited to transfer of job positions to be recruited. In our business model we have payroll outsourcer and the hired persons will be transferred from EREC via SAP PI to the outsourcer and then the outsourcer will send to us the file with new and changed employees and the SAP PI will read them into SAP HR.
    1. are we going to make right landscape? We are now just about to install EREC 606 - will it work with ERP EHP5?
    2. Second question is if we have to activate any business function in SAP HR (ERP)?
    Cheers
    Waldek

    Dear Nicole,
    thank you very much!
    I like to double-check the question no 2:
    - Indeed we have EREC 606 standalone (without ERP component)
    - the SAP ERP system (including HR) EHP5 will communicate with EREC through ALE
    Our hosting partner and application partner are now seriously considering if we need to activate on SAP ERP following BF's:
    HCM_ASR_CI_1
    HCM_MSS_ERC_CI_1
    HCM_HIRE_INT_CI_1
    Your answer means: NO - WE DO NOT NEED TO ACTIVATE THEM (?)

  • Data Transfer between AS400(Linux) and Oracle(Windows Server)

    Hi,
    We have AS400 system which resides on Linux architecture.
    We want to transfer millions of records from AS400 to Oracle which resides on Windows server.
    We think to build Odbc connection on windows machine and accessing to AS400 data from this connection.
    But I am not sure the performance of this approach.
    I would be glad if you share your experiences.
    Regards & Thanks

    Hi,
    ODBC is generally pretty slow in my experience - your alternatives are probably one of the following
    1) use odbc maybe with heterogeneous services on top (this allows you to have a database link directly from oracle to db2)
    2) use a transparent gateway - similar to 1) but has more functionality and will have a licence cost
    3) write some c/java program to do it
    4) dump the data to a flat file, transfer to windows, sqlldr that file in
    It all comes down to how good the performance needs to be (ODBC may be good enough) and how much effort needs to be put i to other approaches.
    I suggest you just give odbc a try, if it looks like its not up to the job then consider alternatives. In the past we've used option 4 for this kind of thing but it is very dependent on the environment you are running in (amount/type of data, speed of network etc).
    Regards,
    Harry

  • Data transfer between external URL and IC WebClient

    Hi All,
    In IC web we are launching an external URL how can we fetch the data of the external URL to IC Web interaction record.
    Thanks,
    Raj.

    If it is not much data..you can use query string..

  • Data transfer b/w SAP to Java using IDOC and Interface SAP Jco

    Dear Experts,
    The challenging requirement we are having is, we need to create the interface for data transfer between SAP system and the Java system. The data will be transferred from SAP to java and similarly once some processing done in Java again the details needs to be transferred from Java to SAP.
    For this data transferred we are planning to use IDOC process and for interface "SAP Java connector (Version 3.0.5)" we are planning to use. As per our understanding, from Java side one program needs to be written to connect with SAP as "Registered program". This registered program will appear in SAP GATEWAY automatically and using tRFC, TCP/IP connection both SAP and Java system will be connected.
    In this case we are having some doubts.
    1. The data from SAP is going to be transfered from one Custom transaction (Z tcode). Once "Outbound IDOC" will get triggered and will carry the details. Now the doubt is, whether the data / details will get transfered to JAVA system automatically or we need to perform any other steps from SAP ABAP coding...(like converting in to flat file, XML file and etc) ??
    2. We are planning to install "SAP Jco" in Java server. Is this correct...??
    3. Other than SAP Jco any other softwares needs to be installed or not..??
    4. Since we are going to trigger the "outbound IDOC" from custom transaction, we are planning to develope one program in SE37. Other than this any other program we need to develop or not..??
    5. Any sample Java program for the SAP Jco version 3.0.5 to create the "Registered program" with SAP..? (e.g. SAP Listener program).?
    If anybody has detailed steps or explanation please share it with us.
    Thanks in advance
    Warm Regards,
    VEL

    Hi All,
      For the above mentioned issue, we implemented JCo software in JAVA system and created the JAVA program including SAP logon credential details like Client, User name, password and Language details.
    When this JAVA program was compiled successfully then, that non SAP system will appear in SAP gateway Tcode.
    Once non SAP system started appearing in SAP gateway that means, both SAP & Non SAP are connected automatically.
    Regards,
    Velmurugan P

  • Data transfer between SAP & Java and Vice versa using IDOC Process

    Dear Experts,
            We are working on one of the good requirement related to data transfer between SAP and Java software. Client requirement is, they want to transfer the data in both the ways (from SAP --> Java and Vice versa also).
    In detail is, after sales order creation using one custom program loading plan details will be calculated. Once loading dates are confirmed then, user will release the sales document to transfer the data from SAP to Java using "Outbound IDOC processing". Similarly in that JAVA software some shipment details will be performed, once completed from JAVA software again details needs to be pumped back to SAP as "Inbound IDOC Processing".
    For this fields are already identified from external software SAP and we are looking for the same to perform the steps in SAP.
    At this stage, I need your expert opinion  / feedback how to go  about at this stage.
    Meaning,  
                     1. What are the customizing steps needs to be done in SAP..?
                     2. How to trigger the :Outbound IDOC process" once the documents are "Released" from custom transaction
                     3. How to create the link between SAP and JAVA to transfer the data between these 2 software
                     4. How to trigger the "Inbound IDOC Process" from JAVA software to SAP and how to store the data in SAP
    Experts, please give your feedback in terms of reply or by sending the step by step process to fulfill this client requirement.
    Thanks for your cooperation.
    Regards,
    Ramesh

    Maybe too many open questions in the same document.
    Maybe you should repost a more specific question in a technical forum.
    This looks like a small project where you already know what you want, maybe you should contract a technical specialist so he proceeds to the implementation!

  • I have problem with data transfer between Windows Server 2012RT and Windows7 (no more than 14kbps) while between Windows Sever 2012RT and Windows8.1 speed is ok.

    I have problem with data transfer between Windows Server 2012RT and Windows7 (no more than 14kbps) while between Windows Sever 2012RT and Windows8.1 speed is ok.

    Hi,
    Regarding the issue here, please take a look at the below links to see if they could help:
    Slow data transfer speed in Windows 7 or in Windows Server 2008 R2
    And a blog here:
    Windows Server 2012 slow network/SMB/CIFS problem
    Hope this may help
    Best regards
    Michael
    If you have any feedback on our support, please click
    here.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

  • Secure the file/data transfer between XI and any third-party system

    Hi All,,
    I would like to use to "secure" SSH on OS Level the file/data transfer between XI and any third-party system Run OS Command before processing and OS command After processing. right now my XI server installed on iSeries OS.
    with ISeries we can't call the Unix commands hope we need to go for AS400 (CL) Programming. If we created the AS400 programm how i can call that in XI.
    If any one have idea pls let me know weather it will work or not.
    Thanks in adavance.
    Venkat

    Hi,
    Thanks for your reply.
    I have red some blogs like /people/krishna.moorthyp/blog/2007/07/31/sftp-vs-ftps-in-sap-pi to call the Unix Shell script in XI.
    But as i know in iSeries OS we can write the shell script we need to go for AS400 programe. If we go with AS400 how we need to call that programe and it will work or not i am not sure there i need some help please.
    Thanks,
    Venkat

  • I am thinking of buying a iPad but my main desktop machine uses Windows 7 and MS Office.  How easy or difficult is it to transfer data files between the iPad and Windows?  Are there obvious problems or the need for some form of conversion programs?

    I am thinking of buying a iPad but my main desktop machine uses Windows 7 and MS Office.  How easy or difficult is it to transfer data files between the iPad and Windows?  Are there obvious problems or the need for some form of conversion programs?
    Many thanks for any advice.
    David

    You don't need conversion programs, iTunes can copy most of your content over to the iPad via the file sharing section, and some apps also support Dropbox, email attachments, transfer via your wifi network. There are a number of apps that you can get that support Microsoft office file (microsoft don't make an app versions of their software) e.g. from Apple there are Pages (word support), Numbers (excel) and Keynote (powerpoint), and from third-parties there are apps such as Documents To Go and QuickOffice HD

Maybe you are looking for

  • Vendor payment report

    Hi gurus, I have a smalll requirement that , my client want to see the vendors payments list on material wise. I tried in FBL1N by selecting the cleared items. and also changed the layout by dragging the material field column in the report. but for t

  • Javax.xml.rpc.soap.SOAPFaultException: SoapException

    Hi... forum I really need your help. I created a web service client. with JDEV 10.1.3, when i crearted a function call i got this error javax.xml.rpc.soap.SOAPFaultException: SoapException      at oracle.j2ee.ws.client.StreamingSender._raiseFault(Str

  • Geocode Error while creating Business Partner in Audit Management

    Hi All, When I try to create business partner in PLMD_AUDIT and assign it to various partner roles like Auditor, Responsible person etc. I am getting error as " Geocoder SAP0: Country specification is (Customizing) " What should be done to avoid this

  • Song sound does quit while playing, Please Help me

    I did buy a song which had a playtime about 5 min. I did put it on my ipod toch and when I listen the song, about 1 min of playing the sound of the song quit while it is still playing! Can anyone tell me how this is posible and/or can help me?

  • Technical Upgrade

    Hi All,           I am new to upgradtion.I am upgrading from 4.6C to ECC6.0. I am working in ABAP.I want the technical upgrade Procedure.LIke Basis people has done the every thing.They given me the system.What i need to do exactly.What is the procedu