Home > Back-end >  C language XML format data should be sent to the socket how
C language XML format data should be sent to the socket how

Time:09-22

XML. Append (" & lt; Alipay>" );
XML. Append (" & lt; Request>" );
XML. Append (" & lt; Transcode> 10002 & lt;/transcode>" );
XML. Append (" & lt; Out_trade_no & gt;" + + "orderNo & lt;/out_trade_no & gt;" );
XML. Append (" & lt; Device_info & gt;" + device + "& lt;/device_info & gt;" );
XML. Append (" & lt;/request>" );
XML. Append (" & lt;/alipay>" );

This is a Java XML format data, socket C how to send the data to someone else's server, no points, and too many do not understand, can anyone doubt dispels doubts, thank you

CodePudding user response:

Come and help the bai

CodePudding user response:

Baidu to a pile of code, that have nothing to ask?

CodePudding user response:

Find inappropriate

CodePudding user response:

The question as you ask: I want to build a house, how cover

You make me how to answer you?

CodePudding user response:

Don't know how many predecessors in the TCP Socket
Send (many) send (less) send (wealth)
Has been so much illness recv (), recv (wealth)
Inside the trap!
http://bbs.csdn.net/topics/380167545

CodePudding user response:

Put the string sent="transmission content";
Write (clientSocketFd, sent c_str (), sent the size ());
//which clientSocketFd for establishing a connection socket,
To end after receiving a message parsing

CodePudding user response:

C can't identify XML format, can only be sent as a string, so parsing task can only to himself

CodePudding user response:

The XML string using the send to send directly

CodePudding user response:

refer to the eighth floor songhtao response:
send XML string directly using send


I the text of the XML file such as: & lt; Device_info & gt; Device
This device is variable is my value to determine, directly, how to deal with this?

CodePudding user response:

C the socket is not identify XML, open the read into a string, after sending,

CodePudding user response:

Righteous string to send, or sent in the form of files

CodePudding user response:

The append estimation is memo and ADD the same function, is the first data stored in the control list or the cache, then one-time send, as for the way to send XML format and byte streams, which at the bottom of the step is always the same, only in response to receiving may according to certain format, to send encrypted data, for example, opened the can't handle the receiving end, the other is such a difference

CodePudding user response:

Just useful to piece mark,

CodePudding user response:

Use char * string sent in XML format data stream,
  • Related