xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> Need More Help :)
dXtr333
post Feb 20 2004, 11:30 PM
Post #1


X-S Enthusiast


Group: Members
Posts: 27
Joined: 19-February 04
Member No.: 101187



The first one is that I tried the socket tutorial on http://www.xfactordev.net/tutorials/subpages/prt10/index.php
and the problem is that I always get socket error 10060 which I've read is connection timeout.
I think the problem is in the connect() function:
CODE

sockaddr_in service;
ZeroMemory(&service, sizeof(sockaddr_in));
service.sin_family    = AF_INET;
service.sin_addr.S_un.S_addr = inet_addr("216.239.57.99");  // google.com ip adress
service.sin_port    = htons(80);

if(connect(sock, (sockaddr *)&service, sizeof(sockaddr)) == SOCKET_ERROR)
{
 debug("Error at connect() - socket error #%ld\n", WSAGetLastError());
 return(false);
}


The other problem I've got is that I can't make the rumble to shake. this is my code, I think it should work dry.gif
CODE

void ShakeLose(void)
{
XINPUT_GAMEPAD gamePad;
ZeroMemory(&gamePad, sizeof(XINPUT_GAMEPAD));

DWORD dwInsertions, dwRemovals;
XGetDeviceChanges(XDEVICE_TYPE_GAMEPAD, &dwInsertions, &dwRemovals);

static HANDLE pGamePad = NULL;

// Check for a gamepad
if(dwInsertions & 1)
 pGamePad = XInputOpen(XDEVICE_TYPE_GAMEPAD, XDEVICE_PORT0, XDEVICE_NO_SLOT, NULL);

   if(pGamePad != NULL)
{
 XINPUT_FEEDBACK feedBack;
 feedBack.Rumble.wRightMotorSpeed = 30000;
 feedBack.Rumble.wLeftMotorSpeed  = 30000;
 XInputSetState(pGamePad, &feedBack);
}
}


anyone think they can correct the codes.. or point out whats wrong smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
SHiZNO
post Feb 21 2004, 12:08 AM
Post #2


X-S Expert
***

Group: Moderator
Posts: 509
Joined: 5-November 02
Member No.: 7598
Xbox Version: v1.0
360 version: none



the code works, might be something to do with your network not being set up right
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
dXtr333
post Feb 21 2004, 02:34 PM
Post #3


X-S Enthusiast


Group: Members
Posts: 27
Joined: 19-February 04
Member No.: 101187



well this is my log from the connection try:

Network started, wait for 1 second
Connecting...
SOCKET = -805196024

Error at connect() - socket error #10060

Exiting...

I'm not sure.. but I think that the socket shouldn't have that value dry.gif

-----------------
well.. I figured the socket can't be wrong, xuz then I would get a INVALID_SOCKET return. So I started rereading all the docs for like the 100 time.. and then at the bottom it was a liitle notes on the lib files.. so I checked my lib files
and discoverd I was linking with xonlines.lib so I tested changing to xonline.lib and now it works! But now I get another problem.. I don't recive anything my log looks like:

recv:
recv:
recv:
recv:
recv:
recv:
and goes on like that and fills the log with 17MB of data! It would have been more if haven't shutdown the power.

so somethings real wrong in here:
int rr = 1;
char aa[5000];
while(rr)
{
rr = recv(sock, aa, 500, 0);
debug("recv: ", aa);
}

-----

Ops.. find my first error in the code:
debug("recv: ", aa); should be debug("recv: %s", aa);
and then I tried removing the while loop
but then I just get some strange symbols back..
and the recv() functions take like a minute to execute also.. while the send() takes like a second

----
just found out it most be some socket error.. sad.gif
trying to fix it now..

----
lol biggrin.gif
just found the error.. I just typed wrong in the send() function wink.gif
oh well.. now it worls smile.gif

This post has been edited by dXtr333: Feb 21 2004, 05:08 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 20th June 2013 - 02:40 AM