找回密码
 加入
搜索
查看: 3136|回复: 3

[网络通信] UDPSend 发送数条目问题

[复制链接]
发表于 2010-2-18 16:06:46 | 显示全部楼层 |阅读模式
每次都是发送到3950条左右就不能再发送了.接收端应该是没问题.

发送端:
#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

$ip=@IPAddress1

UDPStartup()

$socket = UDPBind(@IPAddress1, 65532)

If @error <> 0 Then Exit

$Form1 = GUICreate("测试-发送", 291, 208, 192, 114)

GUISetOnEvent($GUI_EVENT_CLOSE, "_ext")

$Edit1 = GUICtrlCreateEdit("", 8, 28, 273, 116, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_CLIPSIBLINGS,$ES_READONLY,$ws_VSCROLL))

GUICtrlSetData(-1, "")

$Button1 = GUICtrlCreateButton("退出[&Esc]", 168, 176, 113, 25, 0)

GUICtrlSetOnEvent(-1, "_ext")

GUISetState(@SW_SHOW)


While 1

$i = 1
While  $i<80000

        
    GUICtrlSetData($edit1, $i & @CRLF & GUICtrlRead($edit1))
        $connect = UDPOpen("192.168.9.13",514);udp发送数据测试
        $status = UDPSend($connect, StringToBinary($i ,4))
    $i=$i+1
WEnd

                     
WEnd


Func _ext()

    UDPCloseSocket($socket)

        UDPShutdown()

        Exit

EndFunc 
接收端:
#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

$ip=@IPAddress1

UDPStartup()

$socket = UDPBind(@IPAddress1, 514)

If @error <> 0 Then Exit


$Form1 = GUICreate("测试-接收", 291, 208, 192, 114)

GUISetOnEvent($GUI_EVENT_CLOSE, "_ext")

$Edit1 = GUICtrlCreateEdit("", 8, 28, 273, 116, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_CLIPSIBLINGS,$ES_READONLY,$ws_VSCROLL))


GUICtrlSetData(-1, "")


$Button1 = GUICtrlCreateButton("退出[&Esc]", 168, 176, 113, 25, 0)

GUICtrlSetOnEvent(-1, "_ext")

GUISetState(@SW_SHOW)


While 1

        $data = UDPRecv($socket, 500,1)
        If $data <> "" Then
                        $data = BinaryToString($data,4)
                        GUICtrlSetData($edit1, $data & @CRLF & GUICtrlRead($edit1))
                EndIf

WEnd



Func _ext()

    UDPCloseSocket($socket)

        UDPShutdown()

        Exit

EndFunc



   
问题出在哪呢? 谢谢各位了
 楼主| 发表于 2010-2-20 21:57:42 | 显示全部楼层
再顶...哪位大哥能解答下?
发表于 2010-4-3 22:16:09 | 显示全部楼层
顶。。。。。。。。。。。。。。。。。。。
发表于 2010-4-3 22:43:10 | 显示全部楼层
$connect = UDPOpen("192.168.9.13",514);udp发送数据测试
放在循环外呢?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-9 03:37 , Processed in 0.084359 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表