c = task_register(fd_in);
write(fd_out, &c, 1);
break;
+ case '\n':
+ break;
case '\0':
debug("iTasks server shut down\n");
exit(EXIT_SUCCESS);
if((sock_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
pdie("socket");
if(bind(sock_fd, (struct sockaddr*)&sa, sizeof(sa)) == -1)
- pdie("bind\n");
+ pdie("bind");
if(listen(sock_fd, 10) == -1)
- pdie("bind\n");
+ pdie("listen");
printf("Listening on %d\n", port);
fflush(stdout);
}
open_filedescriptors();
+ write(fd, "\n", 1);
long cyclestart;
struct task *curtask;
void sds_publish(int id, int fd)
{
uint8_t cs;
+ char msg[6];
for(cs = 0; cs<MAXSDSS; cs++){
if(sdss[cs].used && sdss[cs].id == id){
debug("Publish %d=%d\n", sdss[cs].id, sdss[cs].value);
- char msg[6];
sprintf(msg, "s%c%c%c\n",
sdss[cs].id,
sdss[cs].value/265,
}
}
debug("SDS identifier unknown: %d\n", id);
-
}
//Start = fst $ toReadableByteCode $ unMain bc
where
bc` = toRealByteCode (unMain bc)
- bc :: Main (ByteCode Int Stmt)
- bc = sds \x=41 In
- {main = x =. x +. lit 1 :. pub x}
+// bc :: Main (ByteCode Int Stmt)
+ bc = sds \x=5 In
+ sds \y=4 In
+ {main = If (y ==. lit 0) (pub x) (x =. x *. y :. y =. y -. lit 1)}
pub :: (ByteCode a b) -> ByteCode a b
pub x = fmp makePub x