Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
90f9552bf0
  1. 12
      crypto777/nanosrc/aio/usock_posix.c

12
crypto777/nanosrc/aio/usock_posix.c

@ -290,7 +290,7 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr,
errno_assert (rc == 0); errno_assert (rc == 0);
rc = bind (self->s, addr, (socklen_t) addrlen); rc = bind (self->s, addr, (socklen_t) addrlen);
printf("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); //printf("usock.%d -> bind rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno));
if (nn_slow (rc != 0)) if (nn_slow (rc != 0))
return -errno; return -errno;
@ -306,7 +306,7 @@ int nn_usock_listen (struct nn_usock *self, int backlog)
/* Start listening for incoming connections. */ /* Start listening for incoming connections. */
rc = listen (self->s, backlog); rc = listen (self->s, backlog);
printf("usock.%d -> listen rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno)); //printf("usock.%d -> listen rc.%d errno.%d %s\n",self->s,rc,errno,nn_strerror(errno));
if (nn_slow (rc != 0)) if (nn_slow (rc != 0))
return -errno; return -errno;
@ -333,7 +333,7 @@ void nn_usock_accept (struct nn_usock *self, struct nn_usock *listener)
#else #else
s = accept (listener->s, NULL, NULL); s = accept (listener->s, NULL, NULL);
#endif #endif
printf("usock.%d -> accept errno.%d s.%d %s\n",self->s,errno,s,nn_strerror(errno)); //printf("usock.%d -> accept errno.%d s.%d %s\n",self->s,errno,s,nn_strerror(errno));
/* Immediate success. */ /* Immediate success. */
if (nn_fast (s >= 0)) { if (nn_fast (s >= 0)) {
@ -393,7 +393,7 @@ void nn_usock_connect (struct nn_usock *self, const struct sockaddr *addr,
/* Do the connect itself. */ /* Do the connect itself. */
rc = connect(self->s,addr,(socklen_t)addrlen); rc = connect(self->s,addr,(socklen_t)addrlen);
printf("usock.%d <- connect (%llx) rc.%d errno.%d %s\n",self->s,*(long long *)addr,rc,errno,nn_strerror(errno)); //printf("usock.%d <- connect (%llx) rc.%d errno.%d %s\n",self->s,*(long long *)addr,rc,errno,nn_strerror(errno));
/* Immediate success. */ /* Immediate success. */
if ( nn_fast(rc == 0) ) if ( nn_fast(rc == 0) )
{ {
@ -1144,7 +1144,7 @@ static int nn_usock_send_raw (struct nn_usock *self, struct msghdr *hdr)
nbytes = sendmsg(self->s,hdr,MSG_NOSIGNAL); nbytes = sendmsg(self->s,hdr,MSG_NOSIGNAL);
#else #else
nbytes = sendmsg(self->s,hdr,0); nbytes = sendmsg(self->s,hdr,0);
printf("sendmsg nbytes.%d\n",(int32_t)nbytes); //printf("sendmsg nbytes.%d\n",(int32_t)nbytes);
#endif #endif
#endif #endif
/* Handle errors. */ /* Handle errors. */
@ -1286,7 +1286,7 @@ static int nn_usock_recv_raw(struct nn_usock *self, void *buf, size_t *len)
#if NN_USE_MYMSG #if NN_USE_MYMSG
nbytes = myrecvmsg(self->s,&hdr,0,(int32_t)iov.iov_len); nbytes = myrecvmsg(self->s,&hdr,0,(int32_t)iov.iov_len);
printf("got nbytes.%d from recvmsg errno.%d %s\n",(int32_t)nbytes,errno,nn_strerror(errno)); //printf("got nbytes.%d from recvmsg errno.%d %s\n",(int32_t)nbytes,errno,nn_strerror(errno));
#else #else
nbytes = recvmsg (self->s, &hdr, 0); nbytes = recvmsg (self->s, &hdr, 0);
#endif #endif

Loading…
Cancel
Save