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: 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: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
|
by: DizelArs |
last post by:
Hi all)
Faced with a problem, element.click() event doesn't work in Safari browser.
Tried various tricks like emulating touch event through a function:
let clickEvent = new Event('click', {...
| |