AcceptConnection Event

Fired when a client connects.

Syntax

ANSI (Cross Platform)
virtual int FireAcceptConnection(OFTPServerAcceptConnectionEventParams *e);
typedef struct {
int ConnectionId;
const char *ClientSSIDCode;
const char *ClientPassword;
int ClientVersion;
int ServerVersion;
int Accept;
int ErrorCode;
char *ErrorDescription; int reserved; } OFTPServerAcceptConnectionEventParams; Unicode (Windows) virtual INT FireAcceptConnection(OFTPServerAcceptConnectionEventParams *e);
typedef struct {
INT ConnectionId;
LPCWSTR ClientSSIDCode;
LPCWSTR ClientPassword;
INT ClientVersion;
INT ServerVersion;
BOOL Accept;
INT ErrorCode;
LPWSTR ErrorDescription; INT reserved; } OFTPServerAcceptConnectionEventParams;
- (void)onAcceptConnection:(int)connectionId :(NSString*)clientSSIDCode :(NSString*)clientPassword :(int)clientVersion :(int*)serverVersion :(int*)accept :(int*)errorCode :(NSString**)errorDescription;
#define EID_OFTPSERVER_ACCEPTCONNECTION 1

virtual INT IPWORKSEDI_CALL FireAcceptConnection(INT &iConnectionId, LPSTR &lpszClientSSIDCode, LPSTR &lpszClientPassword, INT &iClientVersion, INT &iServerVersion, BOOL &bAccept, INT &iErrorCode, LPSTR &lpszErrorDescription);

Remarks

This event fires when a new OFTP connection is made to the server. Use the parameters of this event to verify the identify of the client identified by the ConnectionId. By default the connection will be accepted. To reject the connection set Accept to false.

ClientVersion specifies the OFTP protocol version the client supports. By default the class will use the version requested by the client for the connection. If you wish to restrict connections to a specific OFTP protocol version use this value when determining whether or not to accept the connection. When rejecting the connection based on the OFTP protocol version use ErrorCode 10. Possible values are:

0 OFTP 1.2
1 OFTP 1.3
2 OFTP 1.4
3 OFTP 2.0

ServerVersion specifies the OFTP protocol version the server will use for the connection. By default this will be the same as ClientVersion. This may be set to a different version which will be sent back to the client. Possible values are:

0 OFTP 1.2
1 OFTP 1.3
2 OFTP 1.4
3 OFTP 2.0

When rejecting a connection the ErrorCode and ErrorDescription may optionally be set. Possible common values are:

ErrorCode ErrorDescription
3 User Code Not Known
4 Invalid Password
9 Unspecified Reason
10 Mode or capabilities incompatible
99 Unspecified Reason

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 C++ Edition - Version 20.0 [Build 8203]