iphone network can't connect
<p>this is my code:</p>

<pre><code>- (void)connecToServerUsingCFStream:(NSString *)urlStr portNo: (uint) portNo{    
CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef)urlStr, portNo, &amp;_readStream, &amp;_writeStream);
if (_readStream&amp;&amp;_writeStream) {
    CFReadStreamSetProperty(_readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
    CFWriteStreamSetProperty(_writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
    iStream = (NSInputStream *)_readStream;
    [iStream retain];        
    [iStream setDelegate:self];
    [iStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    [iStream open];

    oStream = (NSOutputStream *)_writeStream;
    [oStream retain];
    [oStream setDelegate:self];
    [oStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
    [oStream open];
}
</code></pre>

<p>}
I call this method,but can't connect to the host,my purpose is connecting to host and then send the packet.</p>

<pre><code>- (void) sendLoginPacket{
Byte frame_header = 0x68;
unsigned short len = 8;    
unsigned short control = 128;
unsigned char adress = 100;    
unsigned char ANF = 1;    
unsigned char Fn = 1;    
 Byte byte[8];
byte[0] = frame_header;
byte[1] = len&amp;0xff;
byte[2] = (len&gt;&gt;8)&amp;0xff;
byte[3] = control&amp;0xff;
byte[4] = (control&gt;&gt;8)&amp;0xff;
byte[5] = adress;
byte[6] = ANF;
byte[7] = Fn;
[oStream write:byte maxLength:sizeof(byte)];}
</code></pre>

<p>when I call this method,the host can be connected,but can,t get the packet,if I call this method again,the host can receive the packet?</p>
