Teonet stream exampleStart stream server: examples/teostream teo-str NULL NULL -p 9000 -r 9099 -a 127.0.0.1
Start stream client: examples/teostream teostream teo-str str -r 9000 -a 127.0.0.1
Created on October 5, 2015, 5:06 PM
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#define TSTR_VERSION "0.0.1"
size_t data_len, void *user_data) {
switch(event) {
break;
{
if(data != NULL) {
printf("Create stream name \"%s\" with peer \"%s\" ...\n",
}
}
} break;
{
printf("Stream name \"%s\" is connected to peer \"%s\" ...\n",
if(write(sd.
fd_out,
"Hello stream!", 14) >= 0);
} break;
{
printf("Can't connect \"%s\" stream to peer \"%s\" during timeout\n",
} break;
{
size_t rc;
printf("Read %d bytes from stream name \"%s\" of peer \"%s\": "
"\"%s\"\n",
}
} break;
{
printf("Stream name \"%s\" was disconnected from peer \"%s\" ...\n",
} break;
default:
break;
}
}
int main(
int argc,
char** argv) {
const char *app_argv[] = { "", "peer_to", "stream_name"};
return (EXIT_SUCCESS);
}