Sponsored Content
Homework and Emergencies Homework & Coursework Questions C TCP/IP Reliable Transmission project not reliable Post 302833177 by kowit010 on Tuesday 16th of July 2013 11:43:34 AM
Old 07-16-2013
Never mind, I had figured it out. It involved simply moving the fprintf calls in the main while loops in both runClient() and runServer() before I wrote the "bytes_read" to "bytes_written" and sent them back and forth. No assistance needed here now!
This User Gave Thanks to kowit010 For This Post:
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Good (reliable!) check if user exists

Hi all, I've been trying to find a good check I can put it in to a shell script to see if a given user exists. Some of the things I've thought about is checking whether they have a home directory, but not all users have a home directory. I've thought about grepping the /etc/passwd file for... (4 Replies)
Discussion started by: _Spare_Ribs_
4 Replies

2. AIX

Reliable dual-boot method for 5.3 and 6.1

Hi All, I am looking for information and advice on a reliable method to support the dual booting between AIX 5.3 and AIX 6.1 I have a 7029-6E3 with 2 x 36Gb disks, hdisk0 (altinst_rootvg) and hdisk1 (rootvg) I have previously used alt_disk_install to upgrade from 5.1->5.3, and now from... (2 Replies)
Discussion started by: KevB
2 Replies

3. Shell Programming and Scripting

Most reliable way to store file contents in an array in bash

Hi Guys, I have a file which has numbers in it separated by newlines as follows: 1.113 1.456 0.556 0.021 -0.541 -0.444 I am using the following code to store these in an array in bash: FILE14=data.txt ARRAY14=(`awk '{print}' $FILE14`) (6 Replies)
Discussion started by: npatwardhan
6 Replies

4. Programming

reliable udp and socket programming

could somebody give me hand programming the attached request. my code isn't complete and i do not really understand how should i implement that. (1 Reply)
Discussion started by: makaveli_
1 Replies

5. Programming

Reliable management of signal SIGPIPE and SIGTERM

I' m note very expert in the reliable manage of signal... but in my server I must manage SIGPIPE for the socket and SIGTERM... I've wrote this but there is something wrong... Can someone explain me with some example the reliable management of signal?? This is what I've wrote in the server ... (2 Replies)
Discussion started by: italian_boy
2 Replies

6. SuSE

Is OpenSuSE 12.1 stable and reliable?

Hi, We are ready to update OpenSuSE for our web servers from 11.2 to either 11.4 or 12.1. 12.1 is still a beta version. Is it stable and reliable enough for production servers? Please share your valuable experiences. Thank you in advance! (5 Replies)
Discussion started by: aixlover
5 Replies

7. Ubuntu

Reliable Video Editing & DVD Burning

I have just about given up trying to find a reliable package. Imagination - Pitvi - Openshot - DVD Styler are just some of those tried, but even if success has been achieved in exporting a viable result - Brasero will not burn it this includes VOB files. It seems that there is no alternative to... (1 Reply)
Discussion started by: Royalist
1 Replies

8. UNIX for Dummies Questions & Answers

Is this website reliable ?

edit by bakunin: content not relevant for our site (and bordering on spam) SNIPped, thread closed. My suggestion is to - before even considering to buy anything online - put more effort in research, i.e. what the web site you write a comment at, is all about. This one here is definitely not for... (1 Reply)
Discussion started by: ethansk
1 Replies
SD_JOURNAL_NEXT(3)						  sd_journal_next						SD_JOURNAL_NEXT(3)

NAME
sd_journal_next, sd_journal_previous, sd_journal_next_skip, sd_journal_previous_skip, SD_JOURNAL_FOREACH, SD_JOURNAL_FOREACH_BACKWARDS - Advance or set back the read pointer in the journal SYNOPSIS
#include <systemd/sd-journal.h> int sd_journal_next(sd_journal* j); int sd_journal_previous(sd_journal* j); int sd_journal_next_skip(sd_journal* j, uint64_t skip); int sd_journal_previous_skip(sd_journal* j, uint64_t skip); SD_JOURNAL_FOREACH(sd_journal* j); SD_JOURNAL_FOREACH_BACKWARDS(sd_journal* j); DESCRIPTION
sd_journal_next() advances the read pointer into the journal by one entry. The only argument taken is a journal context object as allocated via sd_journal_open(3). After successful invocation the entry may be read with functions such as sd_journal_get_data(3). Similarly, sd_journal_previous() sets the read pointer back one entry. sd_journal_next_skip() and sd_journal_previous_skip() advance/set back the read pointer by multiple entries at once, as specified in the skip parameter. The journal is strictly ordered by reception time, and hence advancing to the next entry guarantees that the entry then pointing to is later in time than then previous one, or has the same timestamp. Note that sd_journal_get_data(3) and related calls will fail unless sd_journal_next() has been invoked at least once in order to position the read pointer on a journal entry. Note that the SD_JOURNAL_FOREACH() macro may be used as a wrapper around sd_journal_seek_head(3) and sd_journal_next() in order to make iterating through the journal easier. See below for an example. Similarly, SD_JOURNAL_FOREACH_BACKWARDS() may be used for iterating the journal in reverse order. RETURN VALUE
The four calls return the number of entries advanced/set back on success or a negative errno-style error code. When the end or beginning of the journal is reached, a number smaller than requested is returned. More specifically, if sd_journal_next() or sd_journal_previous() reach the end/beginning of the journal they will return 0, instead of 1 when they are successful. This should be considered an EOF marker. NOTES
The sd_journal_next(), sd_journal_previous(), sd_journal_next_skip() and sd_journal_previous_skip() interfaces are available as a shared library, which can be compiled and linked to with the libsystemd-journal pkg-config(1) file. EXAMPLES
Iterating through the journal: #include <stdio.h> #include <string.h> #include <systemd/sd-journal.h> int main(int argc, char *argv[]) { int r; sd_journal *j; r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY); if (r < 0) { fprintf(stderr, "Failed to open journal: %s ", strerror(-r)); return 1; } SD_JOURNAL_FOREACH(j) { const char *d; size_t l; r = sd_journal_get_data(j, "MESSAGE", &d, &l); if (r < 0) { fprintf(stderr, "Failed to read message field: %s ", strerror(-r)); continue; } printf("%.*s ", (int) l, d); } sd_journal_close(j); return 0; } SEE ALSO
systemd(1), sd-journal(3), sd_journal_open(3), sd_journal_get_data(3), sd_journal_get_realtime_usec(3), sd_journal_get_cursor(3) systemd 208 SD_JOURNAL_NEXT(3)
All times are GMT -4. The time now is 02:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy