Flight Data Query Software

Source: Internet
Author: User

1. Enable dynamic server-side flight Software

Capture Ctrip's one-way, round-trip, and connecting flight data.

Software Interface:

Jar: http://download.csdn.net/detail/a600423444/3648490

Source code: http://download.csdn.net/detail/a600423444/3648536

Ii. php client request demo

<? Phperror_reporting (e_all); $ service_port = 8123; $ address = 'localhost'; $ commonprotocol = getprotobyname ("TCP"); $ socket = socket_create (af_inet, sock_stream, $ commonprotocol ); if ($ socket <0) {echo "cause of socket creation failure :". socket_strerror ($ socket ). "\ n" ;}$ result = socket_connect ($ socket, $ address, $ service_port); if ($ result <0) {echo "socket connection failure cause: ($ result) ". socket_strerror ($ result ). "\ n";} echo "connection created successfully, preparing data \ r \ n"; // One-Way request String concatenation $ in = "flight search 1.0 \ n "; $ in. = "startcty: Sha \ n"; $ in. = "endcity: BJs \ n"; $ in. = "flightway: 1 \ n"; $ in. = "Date: 2011-10-05 \ n"; // round-trip test data for the first test // $ in = "flight search 1.0 \ n"; // $ in. = "startcty: Sha \ n"; // $ in. = "endcity: BJs \ n"; // $ in. = "flightway: 2 \ n"; // $ in. = "Date: 2011-10-05 \ n"; // $ in. = "date2: 2011-10-07 \ n"; // round-trip test data for the second process // $ in = "flight search 1.0 \ n"; // $ in. = "startcty: Sha \ n"; // $ in. = "endcity: BJs \ n"; // $ in. = "flightway: 2 \ n"; // $ in. = "Date: 2011-10-05 \ n"; // $ in. = "date2: 2011-10-07 \ n"; // $ in. = "flight1: ca1516 \ n"; // $ in. = "price1: 790 \ n"; // $ in. = "subclass1: l \ n"; // the first test of the connection // $ in = "flight search 1.0 \ n"; // $ in. = "startcty: Sha \ n"; // $ in. = "endcity: BJs \ n"; // $ in. = "transitcity: Can \ n"; // $ in. = "flightway: 3 \ n"; // $ in. = "Date: 2011-10-05 \ n"; // $ in. = "date2: 2011-10-07 \ n"; // The second test of the connection procedure // $ in = "flight search 1.0 \ n"; // $ in. = "startcty: Sha \ n"; // $ in. = "endcity: BJs \ n"; // $ in. = "transitcity: Can \ n"; // $ in. = "flightway: 3 \ n"; // $ in. = "Date: 2011-10-05 \ n"; // $ in. = "date2: 2011-10-07 \ n"; // $ in. = "flight1: mu5138 \ n"; // $ in. = "price1: 1130 \ n"; // $ in. = "subclass1: Y \ n"; $ out = ''; socket_write ($ socket, $ in, strlen ($ in); echo" data transmission is complete, wait for \ n "; while ($ out = socket_read ($ socket, 4096) {echo $ out;} echo" received \ n "; socket_close ($ socket ); echo $ out;

Returned results:

Connection created successfully. Preparing data
Sending data is complete, waiting for return
7:55:00 | 10:15:00 | Sha | pek | ca | L | 570 | 7 | 7 | 5.0, | ca1858 | G
8:00:00 | 10:15:00 | Sha | pek | Mu | L | 680 | 7 | 7 | 6.0, | mu5101 | S
8:30:00 | 10:50:00 | Sha | pek | Fm | L | 1010 | 70973825 | 5 | 7 | 1, 2 | 3.6 | fm9101 | P
8:55:00 | 11:15:00 | Sha | pek | ca | M | 680 | 7 | 7 | 6.0, | ca1590 | Q
9:00:00 | 11:20:00 | Sha | pek | Mu | L | 1010 | 70973860 | 5 | 7 | 1, 2 | 3.6 | mu5103 | P
Received

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.