본문 바로가기
728x90

BackEnd FrontEnd67

[C] curl 로 pcm 파일 전달하기 FILE *fp; long lSize; char *buffer; fp = fopen ( "record.pcm" , "rb" ); if( !fp ) perror("record.pcm"),exit(1); fseek( fp , 0L , SEEK_END); lSize = ftell( fp ); rewind( fp ); /* allocate memory for entire content */ buffer = ( char *)calloc( 1, lSize+1 ); if( !buffer ) fclose(fp),fputs("memory alloc fails",stderr),exit(1); /* copy the file into the buffer */ if( 1!=fread( buffer , lSize, 1 , fp).. 2019. 10. 23.
c++ : send wav data with curl #include #include #include #include static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) { ((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } int main(void) { std::string contents; std::ifstream in("test2.wav", std::ios::in | std::ios::binary); if (in) { in.seekg(0, std::ios::end); contents.resize(in.tellg()); in.seekg(0, std::ios:.. 2019. 10. 3.
openssl 사용하여 개발하기 전 설치할 것 -lssl sudo apt-get install libssl-dev sudo apt-get install libcurl4-openssl-dev sudo apt-get install libcurl4-gnutls-dev 컴파일 시 아래와 같이 사용 SSL = -L/usr/local/ssl/lib -lssl -lcrypto [참고한 링크] https://aticleworld.com/ssl-server-client-using-openssl-in-c/ [인증서 만들기] openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem ssl server client programming using openssl in c - Aticle.. 2019. 7. 29.
maven에 외부 jar 사용할때 scope 외부 jar 사용할 때 scope을 system으로 정해줘야 소스상에서 사용가능 해당 scope에 대한 정의 이해필요 2019. 7. 12.
728x90