zoukankan
html css js c++ java
Indy UDP端口冲突解决
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdUDPBase, IdUDPServer, StdCtrls,idsockethandle;
type
TForm1
=
class
(TForm)
Button1: TButton;
IdUDPServer1: TIdUDPServer;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R
*
.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var ok:boolean ;
tempport:integer;
asockethandle:tidsockethandle;
begin
tempport:
=
idudpserver1.DefaultPort;
repeat
try
idudpserver1.Active:
=
true
;
ok:
=
true
;
except
on EIdCouldNotBindSocket
do
begin
IdUDPServer1.Active:
=
false
;
IdUDPServer1.Bindings.Clear;
ASocketHandle:
=
IdUDPServer1.Bindings.Add;
tempport:
=
tempport
+
1
;
ASocketHandle.Port:
=
tempport ;
end;
end;
until ok;
showmessage(inttostr(idudpserver1.Binding.Port));
end;
end.
loop's blog
查看全文
相关阅读:
centOS6.8 安装Nginx
Linux 的su 与sudo 的区别,查看所有用户
查看电脑 8080端口号被哪个应用占用
配置文件出错 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
IDEA 代码格式化,快捷键
学习servlet心得
nodejs笔记
Tomcat 7.0.3x 启动慢并且遇到StackOverflowError的异常的解决办法
国管公积金取房本
前端准备技术汇总
原文地址:https://www.cnblogs.com/goodloop/p/62825.html
最新文章
C# 动态修改 Web 服务引用
SQL时间转换函数Convert
C# 程序调用Https问题1
ASP.Net页面生命周期2
ASP.Net页面生命周期1
C# 操作Excel 1
Go语言中的结构体 (struct)
Go语言中的闭包
Go语言程序开发初涉
nginx初学者指南
热门文章
Docker CE 在 CentOS7下安装
Eclipse下egit插件的使用
mysql 二进包在linux下安装过程
常用代码1
异常与日志
开源的API文档工具框架——Swagger简介
Kali 防火墙配置
kali 的端口扫描nmap
Linux防火墙
linux 查看在线服务进程
Copyright © 2011-2022 走看看