从 openedge 应用程序访问的服务器套接字

Server socket accessing from openedge app

我用 C# 做了一个服务器-客户端套接字。这是运行在网络上,一起交流

现在我必须从 openge progress 应用程序客户端进行通信。为了连接到我的 c# 服务器,我尝试了以下代码:

CREATE SOCKET mysocket.

ret = mysocket:CONNECT("-H 192.168.0.8 -S 5463"). /* Point 1 */

IF NOT ret THEN DO: /* Point 2 */

 MESSAGE "Unable to connect to server" VIEW-AS ALERT-BOX.

END.

但是我的客户端无法连接,我收到消息 "Unable to connect."

这可以做吗?

我解决了我的问题。

首先我使用 AppBuilder。我打开一个read_socket.w,其中运行一个文件open_socket.p。这不会连接到我的服务器。

我使用 OpenEdge Developper Studio,创建一个新表单:mySocket.cls。我用这个方法放了一个按钮:

method private void button1_Click( input sender as System.Object, input e as System.EventArgs ):
    define variable mytext as character no-undo.

    define variable i as integer no-undo.

    define variable len as integer no-undo.

    define variable mysocket as handle no-undo.

    define variable mymemptr as memptr no-undo.

    define variable ret as logical no-undo.

    create socket mysocket.

    ret = mysocket:connect("-H 192.168.0.8 -S 5463"). /* Point 1 */

    if not ret then do: /* Point 2 */

     message "Unable to connect to server" view-as alert-box.

    end.



    return.

end method.

这样,连接就发生了
最好的问候