nm_sr_hello.c
/*
* NewMadeleine
* Copyright (C) 2006-2023 (see AUTHORS file)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include "../common/nm_examples_helper.h"
const char *msg = "hello, world";
int main(int argc, char**argv)
{
uint64_t len = 1 + strlen(msg);
{
/* server side */
nm_sr_request_t request;
memset(buf, 0, len);
printf("buffer contents: %s\n", buf);
}
else
{
/* client side */
nm_sr_request_t request;
strcpy(buf, msg);
}
free(buf);
exit(0);
}
static void nm_examples_init_topo(int *argc, char *argv[], enum nm_example_topo_e topo)
Definition nm_examples_helper.h:39
static int nm_sr_swait(nm_session_t p_session, nm_sr_request_t *p_request)
Wait for the completion of a non blocking send request.
static int nm_sr_rwait(nm_session_t p_session, nm_sr_request_t *p_request)
Wait for the completion of a non blocking receive request.
static int nm_sr_irecv(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, void *data, nm_len_t len, nm_sr_request_t *p_request)
Post a non blocking receive request.
Definition nm_sendrecv_interface.h:381
static int nm_sr_isend(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, const void *data, nm_len_t len, nm_sr_request_t *p_request)
Post a non blocking send request.
Definition nm_sendrecv_interface.h:278