Hi
I write dll library which one of it component will be Net socket
communication. Communication is working very good, but i've got problem when
client is connecting. When server is started, client is connecting without
problems; but when servre is down and i start client, client connect to
server!
Few lines from code:
client.Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
client.Socket.BeginConnect(client.EndPoint, new
AsyncCallback(Client_ConnectCallback), client);
and in callback
client.Socket.EndConnect(ar);
Of course client.Socket.Connected is after callback set to true.
What is strange when i call :
client.Socket.BeginSend(msg.Data, 0, msg.Data.Length, SocketFlags.None, new
AsyncCallback(Client_SendCallback), client);
there is no problems.
Receive of course doesn't work.
I execute netstat.exe and connection is alive. So where is this client
connected?
Maybe somebody knew how to test this connection, or how to check this
connection is alive and working?
Of course i can check, that some data was received - but i cannot asure that
some data will be received in some time period.
regards
Kuba Florczyk 2 2365
remove it :
client.Socket.EndConnect(ar);
news.microsoft.com wrote: Hi
I write dll library which one of it component will be Net socket communication. Communication is working very good, but i've got problem when client is connecting. When server is started, client is connecting without problems; but when servre is down and i start client, client connect to server! Few lines from code:
client.Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); client.Socket.BeginConnect(client.EndPoint, new AsyncCallback(Client_ConnectCallback), client);
and in callback
client.Socket.EndConnect(ar);
Of course client.Socket.Connected is after callback set to true.
What is strange when i call :
client.Socket.BeginSend(msg.Data, 0, msg.Data.Length, SocketFlags.None, new AsyncCallback(Client_SendCallback), client); there is no problems.
Receive of course doesn't work.
I execute netstat.exe and connection is alive. So where is this client connected?
Maybe somebody knew how to test this connection, or how to check this connection is alive and working?
Of course i can check, that some data was received - but i cannot asure that some data will be received in some time period.
regards
Kuba Florczyk
Why? What that will change?
kuba remove it :
client.Socket.EndConnect(ar);
news.microsoft.com wrote:
Hi
I write dll library which one of it component will be Net socket communication. Communication is working very good, but i've got problem
whenclient is connecting. When server is started, client is connecting
withoutproblems; but when servre is down and i start client, client connect to server! Few lines from code:
client.Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); client.Socket.BeginConnect(client.EndPoint, new AsyncCallback(Client_ConnectCallback), client);
and in callback
client.Socket.EndConnect(ar);
Of course client.Socket.Connected is after callback set to true.
What is strange when i call :
client.Socket.BeginSend(msg.Data, 0, msg.Data.Length, SocketFlags.None,
newAsyncCallback(Client_SendCallback), client); there is no problems.
Receive of course doesn't work.
I execute netstat.exe and connection is alive. So where is this client connected?
Maybe somebody knew how to test this connection, or how to check this connection is alive and working?
Of course i can check, that some data was received - but i cannot asure
thatsome data will be received in some time period.
regards
Kuba Florczyk This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Darren Thomas |
last post by:
Dear all,
I have written a TCP server as a windows service that accepts connections using the System.Net.Sockets.Socket class. I use the various asynchronous methods in the socket class. I'm...
|
by: news.microsoft.com |
last post by:
Hi
I write dll library which one of it component will be Net socket
communication. Communication is working very good, but i've got problem when
client is connecting. When server is started,...
|
by: Niels Johansen |
last post by:
Hello,
When using the asynchronous read method in the BufferedStream class, , it seems to me that it blocks like
the normal synchronous read method. Why is it so? Why does the...
|
by: Matthew Groch |
last post by:
Hi all,
I've got a server that handles a relatively high number of concurrent
transactions (on the magnitude of 1000's per second). Client
applications establish socket connections with the...
|
by: Richard |
last post by:
Hi,
I'm suffering a socket race condition - I think. The code works fine at
full speed on a single CPU machine. However when I run full speed on a 2
Zeon machine the socket drops data on an...
|
by: Colin |
last post by:
I'm writing a little console socket server but I'm having some
difficulty. Can I ask your advice - where is the best place to get
some help on that topic? It would be nice if some people who knew...
|
by: Macca |
last post by:
My app has an asynchronous socket server. It will have 20 clients connected
to the server. Each client sends data every 500 millisecondsThe Connections
once established will not be closed unless...
|
by: Engineerik |
last post by:
I am trying to create a socket server which will listen for connections from
multiple clients and call subroutines in a Fortran DLL and pass the results
back to the client. The asynchronous socket...
|
by: panko |
last post by:
Hello,
I can't manage with asynchronous socket communication. :(
I wrote a class CSocket.cs.
This class is taking care of sending strings to LED display. This
display is actually communicating...
|
by: raghubr |
last post by:
Hi all,
Can any one pls guide me through..I need to transfer the file from server to client and client to server using sockets in an Asynchronous mode so this file transfer doesn't hinder the...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |