Page 1 of 1

How to add new Socket ?

Posted: 03 Dec 2009 12:49
by brizio
Hi all,
i want to create another thread in vlc 1.0.2 which contains a socket listening on a port for some encoder parameters used by vlc during the encoding, with the aim of change them at runtime, without kill the encoder process..
I'm compiling on WinXP using MINGW http://wiki.videolan.org/Win32CompileMSYSNew
I can successfully compile the source code, but know i've added the code for the new socket (it's not ended but just for test)

Code: Select all

#include <sys/types.h> #include <unistd.h> #include <sys/socket.h> #include <sys/uio.h> #include <sys/un.h> #include <netinet/in.h> #include <pthread.h> ... ... static int StartSocket( ) { struct sockaddr_in server,client; char buffer[50]; int socket = socket (AF_INET, SOCK_STREAM, 0); server.sin_family = AF_INET; server.sin_addr.s_addr = INADDR_ANY; server.sin_port = htons(SERVER_PORT); bind(socket, (struct sockaddr *)&server, sizeof(server)); listen(socket, 1); while(1) { int req=accept(sock, (struct sockaddr *)&client, &client_len); int lenght=recv(req, buffer, 50, 0); } }
in compiling phase, minsys can't find sys/socket.h,sys/uio.h,sys/un.h,netinet/in.h

Should i use a predefined types for vlc instead the one i've done? I've seen that in other files of source code the included file which are missing, seems to be correctly found....
Thanks for your help!

brizio

Re: How to add new Socket ?

Posted: 03 Dec 2009 14:03
by thannoy
Please, please never cross post to two forums. Find what you think is the better place and post it only once.

@duplicated: viewtopic.php?f=2&t=68746