oleska
15th June 2005, 17:30
Hello,
I'm trying to use sock.listen function in Baan 4c, but getting error, unresolved reference. What should i include to be able to compile 3GL code.
Thanks.
Frank
bdittmar
15th June 2005, 18:03
Hello,
I'm trying to use sock.listen function in Baan 4c, but getting error, unresolved reference. What should i include to be able to compile 3GL code.
Thanks.
Frank
Hello, is the service right ?, otherwise use portnumber.
Syntax
long sock.listen( string service.name )
Description
A server calls this function to create a listen socket that it can use to receive connection requests from clients. The function binds the new socket to the address specified by INADDR_ANY and the service specified by service.name. It returns a valid listen socket that sock.accept() can access in order to accept connection requests.
Arguments
service.name
This specifies the name of a service that maps to a port number. The service name is translated to a port number via a platform-specific lookup mechanism such as the /etc/services file or Yellow Pages (YP).
If you do not know the service name, you can specify the port number directly. For example:
sock.listen( "23" )
Notes
If the calling application enables I/O events by calling select.event.input( 0, EVTIOEVENTMASK ), before calling sock.listen(), the application will receive an event when a connection request is pending on the socket. The application can then call sock.accept() on the socket specified in the event. You use next.event() to retrieve events from the event queue. For details of I/O events, see I/O events.
When the calling application does not want to accept any new connections, it must close the listen socket by calling sock.close().
Return values
>0 success; a descriptor for the listen socket is returned
<=0 error; the predefined variable e contains the error number
Context
Bshell function.
oleska
15th June 2005, 18:18
simple 3 Gl program, but i canot copile it, because all 4 functions below are not part of standard library in b4c
socket = sock.listen("4560")
ret = sock.accept(socket)
ret = sock.recv(socket, data, num.bytes )
sock.close(socket)
vahdani
15th June 2005, 19:50
Hi,
socket functionality is apparently only available under Baan V running on Unix and not Baan IV. The implementation is also Operating System dependent. On an old Baan IV Installation (Porting set 6.1c.06.06 Reliant Unix) I get the same error Message "Unresolved reference to function 'sock.listen'".
I just tested the same script on a newer Linux installation (LINUX2.4 Porting set 6.1c.07.07) I can however compile only if I remove the Port Parameter which is also not correct.
The very same script compiled correctly on a BaanVc installation on Unix and did open the port specified!
My advice: Forget sockets, if not on BaanV and Unix! :(
NPRao
15th June 2005, 20:33
I just tested the same script on a newer Linux installation (LINUX2.4 Porting set 6.1c.07.07) I can however compile only if I remove the Port Parameter which is also not correct.
One of the porting sets had a badfix with the function prototypes. Here is the info from the 7.3.a08 Porting set release note, you should check for a corresponding fix for your BaaN version at the support site.
MaintReger: # 23471 (BDUX16266): Error: 2 arguments expected for function
sock.connect()
Date: Fri, 1 Oct 2004 09:25:49 +0200
Created on: MaintReger
Type: bugfix
Problem Description (Customer terms)
Compilation failed when function sock.connect() is used.
zmadmsockcli0:
bic6.2 -Pvariant=0 pzmadmsockcli0 -u -o ozmadmsockcli -f /app/lms/lmss/opt/bse/tmp/tmp061322097 -pacc b52amlgd -qe /app/lms/lmss/opt/bse/tmp/tmp061322099
pzmadmsockcli0( 20): Error: 2 arguments expected for function 'sock.connect'
1 ERROR REPORTED.
Workaround
n/a
Test Procedure
compile a 3gl program that includes function sock.connect().
Affected Executables
bic6.2
bshell6.2
Motive source
DF:221924
oleska
22nd June 2005, 02:23
Thanks guys