×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / Emergency! Win98 and WinNT
    本文发表在 rolia.net 枫下论坛I am developing a winsocket program. when I finished the development, i tested it on win98, it runs well. But when I tested it on WinNT, it always waits for a long time then fails. The details r as followings:

    1) first, I used no-blocking mode to degisn the program, that is an event mode. Simply and technologily speaking, the event mode is that when the TCP/IP connect is setup, an event is created by the system. I just wanna capture the event then send my data.

    2) I think the connection is already setup, but I donot understand why the event isnot created. Because I set a limited time for connection. If the connection is over the time, error message will be hinted, otherwise, the event should be dispatched.

    3) blocking mode is OK. I mean the connection can be created and signal can be return and event can be created. But why isnot NO-BLOCKING mode OK?

    4) BAck to the point, it runs well in WIN98 and failed in WinNT? what the essential difference between 98 and NT? I know there are diference which express in the MACRO defined by WIN32 SDK

    Plz [red]EXPERT[/red] help me!

    The dead line is COMING!!!

    truly,

    Wolf更多精彩文章及讨论,请光临枫下论坛 rolia.net
    • Still no expert at Win socket ?
      If I didnot clarify the question, plz let me know
    • Welcome your comments
    • It seems I have to solve it myself, 55555555.......
    • which language does you use? VC++?
      • ya. VC6.0
    • 大家都去睡了。可我的问题仍未解决, 这个星期怎么过么?
    • Still No Answer and Comments
    • I haven't seen your post until now, it's too far back in the line.
      I guess your problem is caused by the system call to make the socket non-blocking. I never did TCP/IP coding on WIndows system, so this is just my rough evaluation of the problem based on my previous experience.

      Usually , when you need an event driven architecture, you have to make your socket non-blocking because the connect() call is a blocking one, which can prevent the system from doing other things while waiting. On unix , we use fcntl() to change the nature of the socket into a non-blocking one, and on vxWorks, we use ioctl(). I assume you use ioctl() on windows to do the same thing. This ioctl() is a system call, and it has different semantics on different platforms, I guess WinNT and 98 have
      some subtle difference on this function. As a result, when you move your source code from 98 to winNt, something is broken. Give me some fragments of your code, I can take a look at it for you. It's really hard to discussion programming bugs without source code.
      • I just solved the question!
        本文发表在 rolia.net 枫下论坛HI, numnum

        Very nice to meet you here. from your comments, I know you r familiar with the knowledge of socket on UNIX which is the orginal of TCP/IP and socket on BSD system. Thank for your comments.

        I solved the question by using the pure socket functions. I mean , I am using the socket calls which are almost same prototypes with those on BSD. Before that, I used the WSA which is a collection of wIN32 socket encapulated the BSD socket. WSA always failed so I decide to code from the ground. 30 mins ago, I succeeded.

        But I still donot know why WSA cannot run well on WINNT. It should be OK because the one of objectives the colletion want to go is to Simplify the development of socket and reduce the frequence of using original socket calls. It is OK on WIn98 and also is OK on NT. I am still confused with it.

        Anyway, thank you, numnum. But I cannot send code to you, you know, I am taking some risk if I did it. I am very glad to discuss with you here. Later, if I have questions, I would like to notify you first, OK?

        Good Night! You , my friends and ME!

        Wolf更多精彩文章及讨论,请光临枫下论坛 rolia.net