websocket_dynlimic_lib

command module
v0.0.0-...-1fe5f33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 10 Imported by: 0

README

websocket_dynlimic_lib

How to call a simple websocket dynlimic library with go ?

##1. go version

go version go1.16.4 linux/amd64

##2. gcc --version

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23) Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

##3. build go code to dynlimic library

./build.sh

##4. call lib with c

#include "libnway_websocket.h"
//init library
if (nway_asr_init()!=0){
   goto END;
}

 //call function
char* message=malloc(globals.nway_message_len);
nway_memset(message,globals.nway_message_len);
recStatus = nway_asr_sendmessage(rh->r_nway_sid,(void*)firstData,firstSamples,message);
if(recStatus == 0)
{
	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rh->session), SWITCH_LOG_DEBUG, "sent data\n");

}else{
	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rh->session), SWITCH_LOG_ERROR, "sbb error:%s \n",message);

}

##5. compile c code

gcc -o test test.c -L./ -lnway_websocket

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL