Skip to main content
Home
for DLMS smart meters

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

11 months 2 weeks ago

I also tried from…

I also tried from GXDlmsDirector and it is the same.

Profile picture for user Kurumi

Kurumi

11 months 2 weeks 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

11 months 2 weeks 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

11 months 2 weeks ago

Hi, Open uses the default…

Hi,

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

BR,
Mikko

hhkx

11 months 2 weeks 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

11 months 2 weeks 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

11 months 2 weeks 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

11 months 2 weeks 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

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 05/15/2025 - 16:26
    gurux.dlms.c 9.0.2505.1501
  • Wed, 05/14/2025 - 08:30
    gurux.dlms.c 9.0.2505.1401
  • Tue, 05/13/2025 - 10:00
    Gurux.DLMS.Android 2.0.15
  • Fri, 05/09/2025 - 13:03
    Gurux.DLMS.Python 1.0.181
  • Wed, 05/07/2025 - 16:09
    Gurux.DLMS.Android 2.0.14

New forum topics

  • Long reading ends with "Invalid frame ..." error.
  • Push listener example how it works + tcp stream issue
  • Problem with reading energymeter Star DTS27 via GXDLMSDirector
  • Receiver Ready Test Failed
  • Combining several meters' profile generic data into one
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin