Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
GHIElectronics.com
Home
Help
Search
Login
Register
GHI Electronics LLC
>
.NET Micro Framework Devices
>
ChipworkX
>
Slow response during Socket.Connect
Pages: [
1
]
« previous
next »
Print
Author
Topic: Slow response during Socket.Connect (Read 120 times)
nebiros03
Newbie
Posts: 8
Slow response during Socket.Connect
«
on:
July 28, 2010, 11:27:39 PM »
Hello everybody.
I'm currently developing a complex project that involves Sockets communication for a client/server app under microframework 4.0. I've been working on this for a year. At this time we get a first version for our product, but it needs optimization. I've checking the socket communication, and I've watched that each time I need to send a message, by calling the Socket.Connect method, it takes a long time to connect, so I've tricked the proccess to reconnect after to receive the response from the server, But I thing that it is not an ellegant way to resolve this issue, in addition that some times I get the socket blocked, having to reconnect again... what takes a long time again.
Is there any explication about why the Connect process takes me so long?
Thank you for the support.
Logged
support
Administrator
Sr. Member
Posts: 490
Re: Slow response during Socket.Connect
«
Reply #1 on:
July 29, 2010, 08:12:00 AM »
I recommend that you try the example code for sockets provided with Microsoft NETMF SDK and take a look at how the sockets are handled.
We did not notice that Socket.Cnnect() takes long time. On the other hand, this method has long timeout. So if there was no response from the server, expect a considerable time for this method before exiting.
Logged
nebiros03
Newbie
Posts: 8
Re: Slow response during Socket.Connect
«
Reply #2 on:
July 29, 2010, 11:03:25 AM »
Thank you for the opportune support.
Let me describe you the System.
At the server side I have a tcpListener that process the chipworkX request, sending back the required data to a random Port.
At the client side I use a NetwotkStream to Read/Write data on the chipworkX Socket.
I'm using only one socket o read/write data and a thread that continuosly check if there is Data availible on the network stream.
At this point I have some questions.
Why after I receive Data I cannot reuse the same socket to write Data?
Is there a way to keep alive the socket without having to reconnect each time I need to write on the socket?
Logged
support
Administrator
Sr. Member
Posts: 490
Re: Slow response during Socket.Connect
«
Reply #3 on:
July 29, 2010, 01:41:19 PM »
So you mean the socket is closed as soon as you finish the transaction? I can not a certain answer. But you can forward the question to NETMF team
www.netmf.com
on the forum. I am pretty sure you will get an answer from the members.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
.NET Micro Framework Devices
-----------------------------
=> General Discussion
=> ChipworkX
=> EMX
=> Embedded Master
=> USBizi
-----------------------------
FAT File System Chipsets and OEM Boards
-----------------------------
=> General Discussion
=> uALFAT
=> USBwiz
Loading...