Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. client server network problem

client server network problem

Scheduled Pinned Locked Moved C#
helpsysadmincsharpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kim0618
    wrote on last edited by
    #1

    Hi, I write a client server network program, the client part using HttpWebRequest to access the server. The server part uses threading and sockets list to listen the client request. The program worked fine in .NET1.0 and after I upgraded to VS2005 (NET2.0) the program didn't work, with the error in client side as "unable to write data to the transport connection, connection closed by program in host". The strange part is that the error come out in the second access from the client to the server. The first access to server is OK, but the second access can't connect to the server and generated the error. I suspect that this may be due to NET2.0 upgrade, but don't know the exact problem. Anyone can help ? Part of the client code is as below, try { WebRequest request = HttpWebRequest.Create(remoteClientSession.URL); string contentType = "multipart/form-data;"; request.ContentLength = message.Length; request.Method = "POST"; request.Timeout = timeoutTime; Stream requestStream = request.GetRequestStream(); requestStream.Write(message, 0, message.Length); ** error start to throw here requestStream.Close(); } catch (WebException webEx) { } catch (IOException ex) { ** the error throw in here "Unable to write data to the transport connection" } WebResponse response = request.GetResponse(); ..... Thanks

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups