• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
About sockets...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

About sockets...


  • Subject: About sockets...
  • From: malcom <email@hidden>
  • Date: Mon, 27 May 2002 16:12:54 +0200

Hi again...

Heheh I think that I will send many message to the list before to make a
good client...first of all a big thanx to all people that want to help me in
this list.

Now my problem is with Small Sockets (or OmniNetwork)...

I receive a ping timedout message from the software... All seems right...
But... I receive all the data only when the other side is disconnected!

2002-05-27 16:09:31.836 clIRC[370] data: ERROR :Closing Link:
cx[email@hidden] (Ping timeout)

It's strange... I would to receive every single line of data when It's
really sended to me, and not at the end of connection... I think that there
is some thread problems with the sockets... Some time ago I have readed from
this list a similar message...but I can't found it now.

There is the code (again! hihih):

#import <Cocoa/Cocoa.h>
#import "Socket.h"

int main(int argc, const char *argv[])
{
Socket *socket;
NSString *stringa;
NSMutableData* response;
NSString* responseString;

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NS_DURING
stringa = [NSString stringWithFormat:@"NICK cx\n\rUSER dani . . :ciao"];

socket = [[Socket alloc] init];
[socket connectToHostName: @"irc.edisontel.it" port: 6667];
[socket writeString: stringa];

response = [[[NSMutableData alloc] init] autorelease];

/* while ( [socket readData:response] )
{
// Read until other side disconnects
}*/
[socket readData:response];
responseString = [[[NSString alloc] initWithData:response
encoding:[NSString defaultCStringEncoding]]
autorelease];

NSLog(@"data: %@",responseString);
NS_HANDLER
NS_ENDHANDLER
return NSApplicationMain(argc, argv);


[pool release];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: About sockets...
      • From: email@hidden
  • Prev by Date: Re: Database applications
  • Next by Date: Re: cocoa-dev digest, Vol 2 #700 - 18 msgs
  • Previous by thread: Re: File path from image drag and drop
  • Next by thread: Re: About sockets...
  • Index(es):
    • Date
    • Thread