Sponsored Content
Top Forums Programming unable to get end of file while reading HTTP data from socket Post 302244589 by Harish.joshi on Wednesday 8th of October 2008 08:58:13 AM
Old 10-08-2008
Quote:
Originally Posted by calv
The HTTP Protocol is designed to always send the size of the data in the "Content-Length:" field. You must count the bytes you read after the "\r\n\r\n", so you exactly stop, when there is nothing more to receive.

SmilieThanx for all your help, I got the problem fixed I wasn't deploying the select functions properly... Thnx again for ur effort
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using loop reading a file,retrieving data from data base.

Hi All, I am having trouble through, I am reading the input from tab delimited file containing several records, e.g. line1 field1 field2 field3 so on.. line2 field1 field2 field3 so on.. .. .. on the basis of certain fields for each record in input file, I have to retrieve... (1 Reply)
Discussion started by: Sonu4lov
1 Replies

2. Programming

HTTP Keep-Alive socket problem

Hello everyone, I am a newbie in UNIX/Linux socket programming. This is a class project that I had trouble with. ================================================== I was trying to make “Keep-Alive” HTTP connections to the server in a tiny web crawler project. Here is the problem: when I tried... (0 Replies)
Discussion started by: imdupeng
0 Replies

3. UNIX for Advanced & Expert Users

problem with socket reading

I am not able to receive the message on socket in the current process when its waiting for its child to exit. code looks something like below //in one thread of the current process //thread 1 =============================================== int numBytes = read(sockid,buf,SIZE); //Now the... (2 Replies)
Discussion started by: swap007
2 Replies

4. Programming

C - HTTP Socket Programming

Hello everybody, I learning socket programming in C and was wondering if anybody here could help me out. I have two .c programs namely server.c and client.c ....... The client sends a message and the server in turn returns the value. Basically I want to send in a request to a webserver... (24 Replies)
Discussion started by: kev_1234
24 Replies

5. UNIX for Dummies Questions & Answers

Enter data at end of a file

Hi All, I have a sample datafile: 5.1 5.2 0.8 6.1 What I want to do is create an additional 3 rows with the number "0.7". so that I now have: 5.1 5.2 0.8 6.1 0.7 0.7 (3 Replies)
Discussion started by: tintin72
3 Replies

6. Shell Programming and Scripting

Perl: Reading data from other file

Hi, I am writting some perl scripts for daily backup process. In which I want to pass some data/referance from another txt file. Text file contains only one column and multiple rows. I want to pass this data to variables of another perl script. e.g. Refdoc.txt file contains data as: perl1... (3 Replies)
Discussion started by: n.dba
3 Replies

7. Red Hat

RAMDISK: EOF while reading compressed data ...Kernel panic - Unable to mount root

I was following this tutorial on How install the rpmfusion nvidia drivers in Fedora 13: F13, F12 & F11 Nvidia driver guides - FedoraForum.org Here's the tutorial: And this is what I did: First I executed the following commands: su rpm -Uvh ... (0 Replies)
Discussion started by: skyxn3t
0 Replies

8. Programming

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (0 Replies)
Discussion started by: senkerth
0 Replies

9. Shell Programming and Scripting

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (4 Replies)
Discussion started by: senkerth
4 Replies

10. Shell Programming and Scripting

append | to the end of each data in a file

I have a file which has data in the below format: 7810902|6783014102| || |0| |0| |0| |0|||||T|04/13/2006||9423|7421||100|2006-04-13 16:50:28|||2006-04-13 16:50:28|n|51|-1||214 1089929|||||NewSpCreateAction request successful. Activity ID = <826528>||||100|n|2006-04-13 16:50:27|2006-04-13... (3 Replies)
Discussion started by: ankianand88
3 Replies
globus_gram_protocol(3) 				       globus gram protocol					   globus_gram_protocol(3)

NAME
globus_gram_protocol - GRAM Protocol Definition The GRAM Protocol is used to handle communication between the Gatekeeper, Job Manager, and GRAM Clients. The protocol is based on a subset of the HTTP/1.1 protocol, with a small set of message types and responses sent as the body of the HTTP requests and responses. This document describes GRAM Protocol version 2. Framing GRAM messages are framed in HTTP/1.1 messages. However, only a small subset of the HTTP specification is used or understood by the GRAM system. All GRAM requests are HTTP POST messages. Only the following HTTP headers are understood: o Host o Content-Type (set to 'application/x-globus-gram' in all cases) o Content-Length o Connection (set to 'close' in all HTTP responses) Only the following status codes are supported in response's HTTP Status-Lines: o 200 OK o 403 Forbidden o 404 Not Found o 500 Internal Server Error o 400 Bad Request Message Format All messages use the carriage return (ASCII value 13) followed by line feed (ASCII value 10) sequence to delimit lines. In all cases, a blank line separates the HTTP header from the message body. All application/x-globus-gram message bodies consist of attribute names followed by a colon, a space, and then the value of the attribute. When the value may contain a newline or double-quote character, a special escaping rule is used to encapsulate the complete string. This encapsulation consists of surrounding the string with double-quotes, and escaping all double-quote and backslash characters within the string with a backslash. All other characters are sent without modification. For example, the string rsl: &( executable = '/bin/echo' ) ( arguments = 'hello' ) becomes rsl: '&( executable = 'bin/echo' ) (arguments = 'hello' )' This is the only form of quoting which application/x-globus-gram messages support. Use of % HEX HEX escapes (such as seen in URL encodings) is not meaningful for this protocol. Message Types Ping Request A ping request is used to verify that the gatekeeper is configured properly to handle a named service. The ping request consists of the following: POST ping/job-manager-name HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version The values of the message-specific strings are job-manager-name The name of the service to have the gatekeeper check. The service name corresponds to one of the gatekeeper's configured grid-services, and is usually of the form 'jobmanager-<em>scheduler-type</em>'. host-name The name of the host on which the gatekeeper is running. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. Job Request A job request is used to scheduler a job remotely using GRAM. The ping request consists of the HTTP framing described above with the request-URI consisting of job-manager-name, where job-manager name is the name of the service to use to schedule the job. The format of a job request message consists of the following: POST job-manager-name[@user-name] HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version job-state-mask: mask callback-url: callback-contact rsl: rsl-description The values of the emphasized text items are as below: job-manager-name The name of the service to submit the job request to. The service name corresponds to one of the gatekeeper's configured grid-services, and is usually of the form 'jobmanager-<em>scheduler-type</em>'. user-name Starting with GT4.0, a client may request that a certain account by used by the gatekeeper to start the job manager. This is done optionally by appending the @ symbol and the local user name that the job should be run as to the job-manager-name. If the @ and username are not present, then the first grid map entry will be used. If the client credential is not authorized in the grid map to use the specified account, an authorization error will occur in the gatekeeper. host-name The name of the host on which the gatekeeper is running. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. mask An integer representation of the job state mask. This value is obtained from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. These meanings of the various job state values are defined in the GRAM Protocol API documentation. callback-contact A https URL which defines a GRAM protocol listener which will receive job state updates. The from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The job status update messages are defined below. rsl-description A quoted string containing the RSL description of the job request. Status Request A status request is used by a GRAM client to get the current job state of a running job. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following: POST job-contact HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version 'status' The values of the emphasized text items are as below: job-contact The job contact string returned in a response to a job request message, or determined by querying the MDS system. host-name The name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. Callback Register Request A callback register request is used by a GRAM client to register a new callback contact to receive GRAM job state updates. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following: POST job-contact HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version 'register <em>mask</em> <em>callback-contact</em>' The values of the emphasized text items are as below: job-contact The job contact string returned in a response to a job request message, or determined by querying the MDS system. host-name The name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. mask An integer representation of the job state mask. This value is obtained from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. These meanings of the various job state values are defined in the GRAM Protocol API documentation. callback-contact A https URL which defines a GRAM protocol listener which will receive job state updates. The from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The job status update messages are defined below. Callback Unregister Request A callback unregister request is used by a GRAM client to request that the job manager no longer send job state updates to the specified callback contact. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following: POST job-contact HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version 'unregister <em>callback-contact</em>' The values of the emphasized text items are as below: job-contact The job contact string returned in a response to a job request message, or determined by querying the MDS system. host-name The name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. callback-contact A https URL which defines a GRAM protocol listener which should no longer receive job state updates. The from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The job status update messages are defined below. Job Cancel Request A job cancel request is used by a GRAM client to request that the job manager terminate a job. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following: POST job-contact HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version 'cancel' The values of the emphasized text items are as below: job-contact The job contact string returned in a response to a job request message, or determined by querying the MDS system. host-name The name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. Job Signal Request A job signal request is used by a GRAM client to request that the job manager process a signal for a job. The arguments to the various signals are discussed in the globus_gram_protocol_job_signal_t documentation. POST job-contact HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version '<em>signal</em>' The values of the emphasized text items are as below: job-contact The job contact string returned in a response to a job request message, or determined by querying the MDS system. host-name The name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. signal A quoted string containing the signal number and it's parameters. Job State Updates A job status update message is sent by the job manager to all registered callback contacts when the job's status changes. The format of the job status update messages is as follows: POST callback-contact HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version job-manager-url: job-contact status: status-code failure-code: failure-code The values of the emphasized text items are as below: callback-contact The callback contact string registered with the job manager either by being passed as the callback-contact in a job request message or in a callback register message. host-name The host part of the callback-contact URL. This exists only for compatibility with the HTTP/1.1 protocol. message-size The length of the content of the message, not including the HTTP/1.1 header. version The version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string '2'. job-contact The job contact of the job which has changed states. Proxy Delegation A proxy delegation message is sent by the client to the job manager to initiate a delegation handshake to generate a new proxy credential for the job manager. This credential is used by the job manager or the job when making further secured connections. The format of the delegation message is as follows: POST callback-contact HTTP/1.1 Host: host-name Content-Type: application/x-globus-gram Content-Length: message-size protocol-version: version 'renew' If a successful (200) reply is sent in response to this message, then the client will procede with a GSI delegation handshake. The tokens in this handshake will be framed with a 4 byte big-endian token length header. The framed tokens will then be wrapped using the GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP wrapping mode. The job manager will frame response tokens in the same manner. After the job manager receives its final delegation token, it will respond with another response message that indicates whether the delegation was processed or not. This response message is a standard GRAM response message. Note on Security Attributes The following security attributes are needed to communicate with the Gatekeeper: o Authentication must be done using GSSAPI mutual authentication o Messages must be wrapped with support for the delegation message. When using Globus I/O, this is accomplished by using the the GLOBUS_IO_SECURE_CHANNEL_MODE_GSI_WRAP wrapping mode. Changes 2004-08-11 Added information about gridmap choosing Version 11.3 Mon Apr 30 2012 globus_gram_protocol(3)
All times are GMT -4. The time now is 01:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy