Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. WaitTime Not Working For Media.Open()

WaitTime not working for Media.Open()

By hhkx , 4 June, 2024
Forums
Gurux.Net

Hi Kurumi,

I need to increase the connection timeout for socket opening. However, it always waits for around 20 seconds and throw "target machine actively refuses it" exception. This wait time is only working after sending commands. But I think it needs to wait for socket connection as well.

Media = new GXNet()
{
HostName = ipAddress,
Port = port,
Protocol = NetworkType.Tcp,
Server = false,
Trace = TraceLevel.Verbose,
WaitTime = 300 * 1000,
};

Media.Open();

hhkx

2 years 1 month ago

I also tried from…

I also tried from GXDlmsDirector and it is the same.

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, "Target machine actively…

Hi,

"Target machine actively refuses it" error means that there is no server listening in that TCP/IP port. Check that your TCP/IP address and port are correct.

BR,
Mikko

hhkx

2 years 1 month ago

Hi, Still, doesn't it have…

Hi,

Still, doesn't it have to wait until WaitTime? For instance, when connection is very slow..

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, Open uses the default…

Hi,

Open uses the default wait time set by the operating system.

BR,
Mikko

hhkx

2 years 1 month ago

Hi, Then what is it GXNet…

Hi,

Then what is it GXNet.WaitTime for?

Is there any way to make it programmatically using a variable rather than operating system default?

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, You can use WaitTime for…

Hi,

You can use WaitTime for connection wait time in the C# code. That is legacy code for Windows phones and that is not planned to be added for other programming languages.

BR,
Mikko

hhkx

2 years 1 month ago

Hi, That is what I am…

Hi,

That is what I am talking about. It doesn't. I change the WaitTime value in GXNet, but it always waits for 21 seconds.

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, The server returns this…

Hi,

The server returns this error and wait time doesn't affect it.
It means the machine exists but has no services listening on the specified port.

BR,

Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin