Re: Newcomer's CAsyncSocket example: trouble connecting with other clients



Wow, I really hate turning this into a .net discussion in an mfc
group, but I built a CLR console app and this just doesn't send
anything to the Newcomer server: (code in its entirety)

#include "stdafx.h"

using namespace System;
using namespace System::Net::Sockets;


int main(array<System::String ^> ^args)
{
TcpClient^ c = gcnew TcpClient( server,port );
String^ msg = "hello, world!";
array<Byte>^data = Text::Encoding::ASCII->GetBytes( msg );
c->Client->Send( data );

Console::ReadKey();

c->Close();

return 0;
}

The server says its connected, but when I hit a key the server says
?.?.?.? [?] Closed

with the "Last Received Message" edit box empty.

Doing the same thing with csocket and an mfc console app does the same
thing. Just what the heck am I missing in both?
.



Relevant Pages

  • RE: SharePoint
    ... in a console app, it must be something to do with web priviledges. ... I hope other SharePoint actions aren't as convoluted... ... the sid used internally may have been somewhat mangled. ... if you have other sharepoint server ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Odd behavior, vector member, MFC and consol app
    ... Today I used it for the first time in a console app and it does a copy,, but the memory doesn't get allocated properly in the copied vector. ... Further checking and I find the xml class is reaching into the afxmem.cpp while the memory is freed in dbgheap.c the xml stuff is in a dll dynamically linked. ... Does this mean I would have to have an MFC build and a non MFC build if I want to use it in the likes of a console project? ...
    (microsoft.public.vc.mfc)
  • Re: Console application to become COM server?
    ... Microsoft MVP, MCSD ... > and turn your console app into a COM server. ... > the client asks, waits again, works again, ... ...
    (microsoft.public.vc.atl)
  • Re: Console application to become COM server?
    ... what would you recommend a quick way to go about it? ... modifications and turn your console app into a COM server. ... the server starts, waits for the client to call ...
    (microsoft.public.vc.atl)
  • RE: SharePoint
    ... a Windows 2003 server with an admin account running it, ... sharepoint admin permissions that I shouldn't be running into this, ... this without error (like it runs in the console app)? ... Dim profileManager As New UserProfileManager ...
    (microsoft.public.sharepoint.portalserver.development)