I would like use Winsock control with Powercobol. For receive, all ok. But for sending , winsock dont work. With visual basic receive and send work correctly!!!!.
why????
Receive:
01 WCOD PIC X(8).
01 WIP PIC X(50).
INVOKE WINsockIN "GetData" USING WCOD. MOVE "RemoteHostIP" OF WINsockIN TO WIP.
VISUALBASIC:
WsockIN.GetData a, vbString
******************************************************
sending:
01 WCOD PIC X(8).
01 WIP PIC X(50).
01 WR PIC X(50).
IF "STATE" OF WINsockOUT NOT = 0
INVOKE WINsockOUT "CLOSE".
MOVE 1 TO "Protocol" OF WINsockOUT.
MOVE WIP TO "RemoteHost" OF WINsockOUT.
MOVE 4000 TO "RemotePort" OF WINsockOUT.
INVOKE WINsockOUT "SendData" USING by reference WR
VISUALBASIC:
If WsockOUT.State <> sckClosed Then WsockOUT.Close
WsockOUT.Protocol = sckUDPProtocol
WsockOUT.RemoteHost = WsockIN.RemoteHostIP
WsockOUT.RemotePort = 4000
WsockOUT.SendData "RISPOSTA : " & a
******************************************************
why????
Receive:
01 WCOD PIC X(8).
01 WIP PIC X(50).
INVOKE WINsockIN "GetData" USING WCOD. MOVE "RemoteHostIP" OF WINsockIN TO WIP.
VISUALBASIC:
WsockIN.GetData a, vbString
******************************************************
sending:
01 WCOD PIC X(8).
01 WIP PIC X(50).
01 WR PIC X(50).
IF "STATE" OF WINsockOUT NOT = 0
INVOKE WINsockOUT "CLOSE".
MOVE 1 TO "Protocol" OF WINsockOUT.
MOVE WIP TO "RemoteHost" OF WINsockOUT.
MOVE 4000 TO "RemotePort" OF WINsockOUT.
INVOKE WINsockOUT "SendData" USING by reference WR
VISUALBASIC:
If WsockOUT.State <> sckClosed Then WsockOUT.Close
WsockOUT.Protocol = sckUDPProtocol
WsockOUT.RemoteHost = WsockIN.RemoteHostIP
WsockOUT.RemotePort = 4000
WsockOUT.SendData "RISPOSTA : " & a
******************************************************