-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.c
More file actions
38 lines (30 loc) · 732 Bytes
/
render.c
File metadata and controls
38 lines (30 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "connectToServer.h"
/*#include <stdio.h>
#ifdef WIN32
#include <winsock2.h>
#else
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#endif
*/
#define MAXLENGTH 500
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
int sockd;
/* Check for proper number of arguments */
if (nrhs != 0) {
mexErrMsgTxt("render takes no arguments.");
} else if (nlhs != 0) {
mexErrMsgTxt("render takes no output arguments.");
}
sockd = ConnectTo("localhost",4765);
if (sockd < 0)
mexErrMsgTxt("Could not connect");
Writeline(sockd,"render\n",7);
CloseConnection(sockd);
return;
}