I seem to recall that in C, one can define multiple function declarations
for the same function.
Is it possible to do the same at Pike level?
Example, I have a function declared as void foo(mixed ... bar);
Now I want to check, and enforce two different declarations:
void foo(string s, mixed ... bar);
void foo(function f, string s, mixed ... bar);
Can I, at Pike level, declare somehow that the above two prototypes
are the only two valid prototypes for this function?
So that Pike will give me …
[View More]a syntax error if I try to do foo(23); ?
--
Stephen.
[View Less]
On Tue, Mar 10, 2015 at 10:05 PM, Mirar @ Pike developers forum
<10353(a)lyskom.lysator.liu.se> wrote:
> Wait, I said REUSEPORT? What's the difference to REUSEADDR? Mysteries
> of TCP sockets...
Here's a decent explanation, I think:
http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and…
ChrisA
Hi guys!
Does anyone know how to solve this?
make[2]: *** No rule to make target '/home/poppa/src/pike-git/devel/src/hashtable.h', needed by 'cpp.o'. Stop.
Makefile:149: recipe for target '_make_in_builddir' failed
make[1]: *** [_make_in_builddir] Error 2
Makefile:66: recipe for target 'compile' failed
make: *** [compile] Error 2
It seems to have happend after commit dcf57dec52f15cda0dc07bbaf2198a250b37030c
Regards
-----------------------------
Pontus Östlund
Developer • Roxen AB
+46 70-…
[View More]662 81 69
www.roxen.com <http://www.roxen.com/> | twitter.com/roxen <https://twitter.com/roxen>
[View Less]
On Unix, you can happily select() on any file descriptors, including
stdin and sockets. On Windows, that doesn't appear to be the case.
Here's a simple form of netcat:
object sock;
void sockread(mixed id, string data) {
//Restrict to ASCII printables for simplicity
write(filter(data, lambda(int c) {return has_value("\t\r\n", c) ||
(c >= 32 && c < 128);}));
}
void console(mixed id, string data) {sock->write(data);}
int main() {
sock = Stdio.File();
sock->…
[View More]connect("minstrelhall.com", 221);
sock->set_read_callback(sockread);
Stdio.stdin->set_read_callback(console);
return -1;
}
The important aspects of this are read callbacks on both a socket and
Stdio.stdin, and returning -1 from main. Comment out the stdin
callback and all is well. Keep it in, and the program runs fine on
Unix, but on Windows, bombs out:
/home/zino/hack/pike8-rel/pike/src/backend.cmod:5496: Fatal error:
Filedescriptor 0 (IS CONSOLE) caused fatal error 10038 in backend.
Backtrace at time of fatal:
-:1: Pike.Backend(0)->`()(3600.0)
This happens with both 7.8 and 8.0 stables on Windows 7, though I
doubt it'll be any different on other Pikes or Windowses.
Is there any good way to respond to console and sockets? For now, I
think I'll just write this off as "Windows sucks" and disable the
console (it's only a debug/emergency feature anyway).
ChrisA
[View Less]