CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    1

    Trouble using Winsock from c#.net

    hello,
    i am trying to transalte a code from VB6 which connects to a server and communicates with it to C# (after failing to do so with interop.)
    first i tried converting to socket connection(TcpClient) but the connection
    didn't seem to work quite well (the connection was forcibly closed by the remote host).
    now i attempt using the MSWINSCK.OCX from my C# project. but when i get
    to the DataArrived event, and call the GetData method - it does not return any value
    and get stuck (control does not return to my code).
    while in VB6 - it works just fine.

    does anybody know why this might be caused? any better ways to emulate
    winsock connection from .net projects?

    thanks ahead!

  2. #2
    Join Date
    Jun 2002
    Location
    Sweden
    Posts
    467

    Re: Trouble using Winsock from c#.net

    I have never had any problems in C# with either TcpClient or Socket. Can you show us some code?

    "the connection was forcibly closed by the remote host" means that the other side closed the connection. Maybe you sent something that it didnt expect?
    "The making of software, like the making of sausages, should never be watched."

    http://blog.gauffin.org - .NET Coding/Architecture

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured