Open hgj100 opened 7 years ago
Since the AS3/Flash Player support for sockets doesn't map easily to posix sockets, it wasn't implemented in crossbridge. You can use AS3 sockets and pass data back and forth via inline_as3(). In other words, you can use sockets in your C++ app, but you'd need to write your own implementation.
Hope this helps!
client.c is a test code. This file contains socket API for example socket, connect, send, why only 'connect' result in link error?
source code client.c :
include <netinet/in.h>
include <sys/types.h>
include <sys/socket.h>
include
include
include
include <arpa/inet.h>
include
int test(int argc, char **argv) { int client_socket, port; struct sockaddr_in serv_addr; if(argc != 3) { printf("useage:socket_client ipaddress port"); return -1; }
}
source code main.c :
include "AS3/AS3.h"
int main() { AS3_GoAsync(); }
when compile, $ make -------- Sample 5 --------
Now compile a SWC and demo SWF "/cygdrive/c/Crossbridge/sdk/usr/bin/g++" -Werror -Wno-write-strings -Wno-trigraphs -O4 main.cpp client.c -emit-swc=sample.test -o test.swc /tmp/cclj1lfj.o: error: undefined reference to '_connect' collect2: ld returned 1 exit status Makefile:2: recipe for target `T05' failed make: *** [T05] Error 1
If crossbridge sdk have some problem?