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 ago

I also tried from…

I also tried from GXDlmsDirector and it is the same.

Profile picture for user Kurumi

Kurumi

2 years 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 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 ago

Hi, Open uses the default…

Hi,

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

BR,
Mikko

hhkx

2 years 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 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 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 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

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin