Closed RSeroka closed 9 years ago
Hi, The simpliest solution is to add an empty connect method in your program, like here: https://github.com/crossbridge-community/crossbridge-swc-openssl/blob/master/clientlib.c (line 98) The proper solution would be to implement Sockets using inline AS3.
OpenSSL code is translated into ActionScript ByteCode so you have to use AS3 API, because the SWF runs inside the Flash Player, so no native APIs are present.
Closing this one. It's not possible to use the socket in OpenSSL because everything is translated to actionscript/bytecode.
In plain cygwin, I can create a simple .c program to create a tcp client socket and connect to remote tcp socket. In crossbridge, this fails with a link error /tmp/ccqLouBl.o: error: undefined reference to '_connect'
I can't use inline AS3 to access a socket because I wish to use the socket in OpenSSL which requires a file descriptor.
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ uname -a CYGWIN_NT-6.1-WOW64 R-SEROKA 1.7.32(0.274/5/3) 2014-08-13 23:03 i686 Cygwin
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ gcc --version gcc (GCC) 4.8.3 Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ gcc -o clientSocket clientSocket.c
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ clientSocket How about getting a socket! fd=3
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ bash
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ PATH=/cygdrive/c/Program\ Files/Java/jdk1.7.0_03/bin:/cygdrive/c/Applications/Crossbridge/15.0.0.3/sdk/usr/bin:$PATH
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ gcc --version gcc (GCC) 4.2.1 for Adobe AVM2 (Based on Apple Inc. build 5658) (LLVM build) Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ uname -a FreeBSD localhost.localdomain 8.2-RELEASE FreeBSD 8.2-RELEASE (compatible; Adobe Flascc 2.0) AVM2
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ gcc -o clientSocket clientSocket.c /tmp/ccqLouBl.o: error: undefined reference to '_connect' java.io.FileNotFoundException: C:\cygwin\tmp\swfresolve.in.b8tzV8 (The system cannot find the path specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:138)
at flascc.AlcTool.swfresolve(AlcTool.java:414)
at flascc.AlcTool.main(AlcTool.java:59)
collect2: ld returned 1 exit status
rseroka@R-SEROKA /cygdrive/c/users/rseroka/My Documents/TestProjects/openssl/crossbridge/sample $ cat clientSocket.c