
Remote Control
Users Guide
6-16
return 0; /* OK */
}
/****************************************************************************
**/
socket_t socket_create(void)
{
socket_handle_t sh;
socket_t s;
sh = socket(AF_INET,SOCK_STREAM,0);
#if WIN
if ( sh == INVALID_SOCKET )
{
wsa_error("socket",-1);
return NULL;
}
#endif
s = calloc(1,sizeof(*s));
if ( !s )
return NULL;
s->h = sh;
return s; /* OK */
}
/****************************************************************************
**/
int socket_connect(socket_t s,struct sockaddr *addr,int addrlen)
{
int ret = 0; /* OK */
#if WIN
if ( connect(s->h,addr,addrlen) == SOCKET_ERROR )
{
wsa_error("connect",-1);
return -1;
}
#endif
return 0; /* OK */
}
/****************************************************************************
**/
int socket_recv(socket_t s,void *buf,int len,int flags)
{
register int l;
#if WIN
l = recv(s->h,buf,len,flags);
if ( l == SOCKET_ERROR )
{
Summary of Contents for NORMA 4000 Operators
Page 6: ...Remote Control Users Guide iv ...
Page 8: ...Remote Control Users Guide vi ...
Page 10: ...Remote Control Users Guide viii ...
Page 26: ...Remote Control Users Guide 2 2 ...
Page 38: ...Remote Control Users Guide 3 2 ...
Page 50: ...Remote Control Users Guide 4 2 ...
Page 150: ...Remote Control Users Guide 4 102 ...
Page 152: ...Remote Control Users Guide 5 2 ...
Page 160: ...Remote Control Users Guide 6 2 ...
Page 184: ...Remote Control Users Guide 6 26 ...